ext4: Fix deadlock in ext4_write_begin() and ext4_da_write_begin()
authorJan Kara <jack@suse.cz>
Thu, 5 Mar 2009 07:34:07 +0000 (02:34 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 17 Mar 2009 00:53:06 +0000 (17:53 -0700)
commit5b9c305d22fb08a6b62f407e187f8f2a5b91c54f
tree45a5796c7edd50cc725c39a9d0a94fda49dda33f
parent3d2f446880e9c0cd89aed563dae0d34d379a0826
ext4: Fix deadlock in ext4_write_begin() and ext4_da_write_begin()

(cherry picked from commit ebd3610b110bbb18ea6f9f2aeed1e1068c537227)

Functions ext4_write_begin() and ext4_da_write_begin() call
grab_cache_page_write_begin() without AOP_FLAG_NOFS. Thus it
can happen that page reclaim is triggered in that function
and it recurses back into the filesystem (or some other filesystem).
But this can lead to various problems as a transaction is already
started at that point. Add the necessary flag.

http://bugzilla.kernel.org/show_bug.cgi?id=11688

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ext4/inode.c