Xin Zhong 914ee295af Btrfs: pwrite blocked when writing from the mmaped buffer of the same page
This problem is found in meego testing:
http://bugs.meego.com/show_bug.cgi?id=6672
A file in btrfs is mmaped and the mmaped buffer is passed to pwrite to write to the same page
of the same file. In btrfs_file_aio_write(), the pages is locked by prepare_pages(). So when
btrfs_copy_from_user() is called, page fault happens and the same page needs to be locked again
in filemap_fault(). The fix is to move iov_iter_fault_in_readable() before prepage_pages() to make page
fault happen before pages are locked. And also disable page fault in critical region in
btrfs_copy_from_user().

Reviewed-by: Yan, Zheng<zheng.z.yan@intel.com>
Signed-off-by: Zhong, Xin <xin.zhong@intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2010-12-10 16:29:10 -05:00
..
2010-06-16 18:05:05 +02:00
2010-08-09 16:48:53 -04:00
2010-10-07 08:01:50 -07:00
2010-08-18 01:01:33 -04:00
2010-05-19 22:41:57 -04:00
2010-08-05 14:23:45 -05:00
2010-08-09 16:48:45 -04:00
2010-08-18 01:09:01 -04:00
2010-08-18 06:21:10 -04:00
2010-08-09 16:48:17 -04:00
2010-08-09 16:48:16 -04:00
2010-08-09 16:47:49 -04:00
2010-08-18 01:09:01 -04:00
2010-08-18 01:09:01 -04:00
2010-08-14 00:24:24 +02:00
2010-08-09 16:47:31 -04:00
2010-08-09 16:48:00 -04:00
2010-08-18 01:09:01 -04:00
2010-08-18 01:09:01 -04:00
2010-08-18 08:35:48 -04:00
2010-05-11 17:43:58 +02:00
2010-08-18 08:35:48 -04:00
2010-08-18 08:35:46 -04:00
2010-08-18 08:35:48 -04:00
2010-03-08 16:55:37 +01:00
2010-05-21 18:31:17 -04:00
2010-08-18 08:35:48 -04:00
2010-08-18 08:35:47 -04:00
2010-06-10 19:08:34 +02:00
2010-08-18 08:35:48 -04:00
2010-03-12 15:52:32 -08:00
2010-08-09 16:48:44 -04:00
2010-08-18 08:35:48 -04:00
2010-08-09 16:47:43 -04:00