mirror-linux/fs/9p
David Howells 2c8f4742bb
netfs: Fix potential for tearing in ->remote_i_size and ->zero_point
Fix potential tearing in using ->remote_i_size and ->zero_point by copying
i_size_read() and i_size_write() and using the same seqcount as for i_size.

We need to make sure that netfslib and the filesystems that use it always
hold i_lock whilst updating any of the sizes to prevent i_size_seqcount
from getting corrupted.

Fixes: 4058f74210 ("netfs: Keep track of the actual remote file size")
Fixes: 100ccd18bb ("netfs: Optimise away reads above the point at which there can be no data")
Closes: https://sashiko.dev/#/patchset/20260414082004.3756080-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://patch.msgid.link/20260512123404.719402-6-dhowells@redhat.com
cc: Paulo Alcantara <pc@manguebit.org>
cc: Matthew Wilcox <willy@infradead.org>
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
2026-05-12 14:42:30 +02:00
..
Kconfig 9p: Remove INET dependency 2023-05-04 21:46:57 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
acl.c posix_acl: make posix_acl_to_xattr() alloc the buffer 2026-01-16 10:51:12 +01:00
acl.h fs: port ->set_acl() to pass mnt_idmap 2023-01-19 09:24:27 +01:00
cache.c mm, netfs, fscache: stop read optimisation when folio removed from pagecache 2023-08-18 10:12:13 -07:00
cache.h fs/9p: Rework cache modes and add new options to Documentation 2023-04-09 21:41:21 +00:00
fid.c 9p: v9fs_fid_find: also lookup by inode if not found dentry 2024-09-23 05:51:27 +09:00
fid.h fs/9p: fix the cache always being enabled on files with qid flags 2024-03-28 15:10:29 +00:00
v9fs.c 9p: fix access mode flags being ORed instead of replaced 2026-04-16 02:56:29 +00:00
v9fs.h 9p: convert to the new mount API 2025-11-03 16:49:53 +09:00
v9fs_vfs.h netfs: Fix potential for tearing in ->remote_i_size and ->zero_point 2026-05-12 14:42:30 +02:00
vfs_addr.c treewide: change inode->i_ino from unsigned long to u64 2026-03-06 14:31:28 +01:00
vfs_dentry.c fs/9p: delete unnnecessary condition 2025-11-03 16:49:53 +09:00
vfs_dir.c fs: remove simple_nosetlease() 2026-01-12 10:55:48 +01:00
vfs_file.c fs: remove simple_nosetlease() 2026-01-12 10:55:48 +01:00
vfs_inode.c netfs: Fix potential for tearing in ->remote_i_size and ->zero_point 2026-05-12 14:42:30 +02:00
vfs_inode_dotl.c netfs: Fix potential for tearing in ->remote_i_size and ->zero_point 2026-05-12 14:42:30 +02:00
vfs_super.c 9p: fix memory leak in v9fs_init_fs_context error path 2026-04-16 01:53:42 +00:00
xattr.c Bunch of small fixes: 2023-11-04 09:20:04 -10:00
xattr.h 9p: move xattr-related structs to .rodata 2023-10-09 16:24:16 +02:00