Re: [PATCH] ext4: Rewrite ext4_page_mkwrite() to return locked page
From: Ted Ts'o <tytso@mit.edu>
Date: 2011-06-06 02:17:58
From: Ted Ts'o <tytso@mit.edu>
Date: 2011-06-06 02:17:58
On Mon, May 30, 2011 at 05:03:49PM +0200, Jan Kara wrote:
ext4_page_mkwrite() does not return page locked. This makes it hard to avoid races with filesystem freezing code (so that we don't leave writeable page on a frozen fs) or writeback code (so that we allow page to be stable during writeback). Also the current code uses i_alloc_sem to avoid races with truncate but that seems to be the wrong locking order according to lock ordering documented in mm/rmap.c. 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>
I'm not sure this commit description is accurate --- or I'm horribly confused. The old code was in fact returning the page locked --- I assume you're referring to lock_page(page) (which is called right before the normal path return). So what am I missing? - Ted