ext4: Convert to use mapping->invalidate_lock
authorJan Kara <jack@suse.cz>
Thu, 4 Feb 2021 17:05:42 +0000 (18:05 +0100)
committerJan Kara <jack@suse.cz>
Tue, 13 Jul 2021 12:29:00 +0000 (14:29 +0200)
commitd4f5258eae7b38c2a28d0a7b28a6d0a8c1f9fe8e
tree9878725ed6feb4691c42d900917fe89775ee8439
parent7506ae6a7033f617ca5fea53e356fb1f7bd98010
ext4: Convert to use mapping->invalidate_lock

Convert ext4 to use mapping->invalidate_lock instead of its private
EXT4_I(inode)->i_mmap_sem. This is mostly search-and-replace. By this
conversion we fix a long standing race between hole punching and read(2)
/ readahead(2) paths that can lead to stale page cache contents.

CC: <linux-ext4@vger.kernel.org>
CC: Ted Tso <tytso@mit.edu>
Acked-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/ext4/ext4.h
fs/ext4/extents.c
fs/ext4/file.c
fs/ext4/inode.c
fs/ext4/ioctl.c
fs/ext4/super.c
fs/ext4/truncate.h