aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/inode.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2021-04-21 17:18:39 +0200
committerJan Kara <jack@suse.cz>2021-07-13 14:29:01 +0200
commit8bcbbe9c7c8e49281fc2e0a6c5455b87c85a9c2a (patch)
treee278ecd836e4441bd4af2d0bfdabcda6059e0ff3 /fs/fuse/inode.c
parentf2fs: Convert to using invalidate_lock (diff)
downloadlinux-dev-8bcbbe9c7c8e49281fc2e0a6c5455b87c85a9c2a.tar.xz
linux-dev-8bcbbe9c7c8e49281fc2e0a6c5455b87c85a9c2a.zip
fuse: Convert to using invalidate_lock
Use invalidate_lock instead of fuse's private i_mmap_sem. The intended purpose is exactly the same. 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: Miklos Szeredi <miklos@szeredi.hu> Reviewed-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to '')
-rw-r--r--fs/fuse/inode.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index b9beb39a4a18..e07e429f32e1 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -85,7 +85,6 @@ static struct inode *fuse_alloc_inode(struct super_block *sb)
fi->orig_ino = 0;
fi->state = 0;
mutex_init(&fi->mutex);
- init_rwsem(&fi->i_mmap_sem);
spin_lock_init(&fi->lock);
fi->forget = fuse_alloc_forget();
if (!fi->forget)