Greg Kroah-Hartman 40012163e5 Revert "ocfs2: should wait dio before inode lock in ocfs2_setattr()"
This reverts commit c4baa4a5870cb02f713def1620052bfca7a82bbb which is
commit 28f5a8a7c033cbf3e32277f4cc9c6afd74f05300 upstream.

It shouldn't be applied to the 4.4-stable tree.

Ben and Alex write:

> Now that ocfs2_setattr() calls this outside of the inode locked region,
> what prevents another task adding a new dio request immediately
> afterward?
>

In the kernel 4.6, firstly, we use the inode_lock() in do_truncate() to
prevent another bio to be issued from this node.
Furthermore, we use the ocfs2_rw_lock() and ocfs2_inode_lock() in ocfs2_setattr()
to guarantee no more bio will be issued from the other nodes in this cluster.

> Also, ocfs2_dio_end_io_write() was introduced in 4.6 and it looks like
> the dio completion path didn't previously take the inode lock.  So it
> doesn't look this fix is needed in 3.18 or 4.4.

Yes, ocfs2_dio_end_io_write() was introduced in 4.6 and the problem this patch
fixes is only exist in the kernel 4.6 and above 4.6.

Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Cc: Alex Chen <alex.chen@huawei.com>
Cc: Jun Piao <piaojun@huawei.com>
Cc: Joseph Qi <jiangqi903@gmail.com>
Cc: Changwei Ge <ge.changwei@h3c.com>
Cc: Mark Fasheh <mfasheh@versity.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-09 18:42:43 +01:00
..
2015-06-30 19:44:57 -07:00
2017-08-06 19:19:42 -07:00
2015-06-25 17:00:42 -07:00
2017-11-30 08:37:20 +00:00
2017-06-14 13:16:24 +02:00
2017-12-05 11:22:52 +01:00
2017-08-06 19:19:42 -07:00
2016-11-10 16:36:34 +01:00
2017-06-14 13:16:24 +02:00
2015-11-13 20:34:33 -05:00
2015-11-23 21:11:08 -05:00
2017-10-08 10:14:20 +02:00
2016-10-07 15:23:47 +02:00
2015-11-10 12:07:22 -08:00
2017-06-14 13:16:24 +02:00
2015-11-16 23:54:45 -08:00
2017-08-06 19:19:42 -07:00
2017-07-15 11:57:44 +02:00
2015-11-16 23:54:45 -08:00
2015-08-12 15:28:45 -05:00
2016-08-10 11:49:27 +02:00
2017-06-14 13:16:24 +02:00
2017-08-06 19:19:42 -07:00
2017-06-14 13:16:24 +02:00