summaryrefslogtreecommitdiff
path: root/fs/ext4/ext4.h
diff options
context:
space:
mode:
authorJan Kara <jack@suse.com>2015-12-07 19:31:11 (GMT)
committerTheodore Ts'o <tytso@mit.edu>2015-12-07 19:31:11 (GMT)
commit32ebffd3bbb4162da5ff88f9a35dd32d0a28ea70 (patch)
tree11d7854acb61128821b948796d1eb2e2f87b925f /fs/ext4/ext4.h
parent17048e8a083fec7ad841d88ef0812707fbc7e39f (diff)
downloadlinux-32ebffd3bbb4162da5ff88f9a35dd32d0a28ea70.tar.xz
ext4: fix races between buffered IO and collapse / insert range
Current code implementing FALLOC_FL_COLLAPSE_RANGE and FALLOC_FL_INSERT_RANGE is prone to races with buffered writes and page faults. If buffered write or write via mmap manages to squeeze between filemap_write_and_wait_range() and truncate_pagecache() in the fallocate implementations, the written data is simply discarded by truncate_pagecache() although it should have been shifted. Fix the problem by moving filemap_write_and_wait_range() call inside i_mutex and i_mmap_sem. That way we are protected against races with both buffered writes and page faults. Signed-off-by: Jan Kara <jack@suse.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4.h')
0 files changed, 0 insertions, 0 deletions