diff options
author | Xin Zhong <xin.zhong@intel.com> | 2010-12-09 10:30:14 +0100 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2010-12-10 22:29:10 +0100 |
commit | 914ee295af418e936ec20a08c1663eaabe4cd07a (patch) | |
tree | 2e880ea913b8cbadf22b2288b5c278c2e5eadb60 /fs/btrfs/ioctl.h | |
parent | Btrfs: Fix a crash when mounting a subvolume (diff) | |
download | linux-914ee295af418e936ec20a08c1663eaabe4cd07a.tar.xz linux-914ee295af418e936ec20a08c1663eaabe4cd07a.zip |
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>
Diffstat (limited to 'fs/btrfs/ioctl.h')
0 files changed, 0 insertions, 0 deletions