ext4: Rewrite ext4_page_mkwrite() to use generic helpers
authorJan Kara <jack@suse.cz>
Fri, 24 Jun 2011 18:29:41 +0000 (14:29 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 21 Jul 2011 00:47:45 +0000 (20:47 -0400)
commit9ea7df534ed2a18157434a496a12cf073ca00c52
treef8fa09102093cbc60249f96ec4fb91985ae8659b
parent582686915803e34adc8fdcd90bff7ca7f6a42221
ext4: Rewrite ext4_page_mkwrite() to use generic helpers

Rewrite ext4_page_mkwrite() to use __block_page_mkwrite() helper. This
removes the need of using i_alloc_sem to avoid races with truncate which
seems to be the wrong locking order according to lock ordering documented in
mm/rmap.c. Also calling ext4_da_write_begin() as used by the old code seems to
be problematic because we can decide to flush delay-allocated blocks which
will acquire s_umount semaphore - again creating unpleasant lock dependency
if not directly a deadlock.

Also add a check for frozen filesystem so that we don't busyloop in page fault
when the filesystem is frozen.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/ext4/inode.c