linux/fs/9p
Dominique Martinet 19d1c32652 9p: fix enodata when reading growing file
Reading from a file that was just extended by a write, but the write had
not yet reached the server would return ENODATA as illustrated by this
command:
$ xfs_io -c 'open -ft test' -c 'w 4096 1000' -c 'r 0 1000'
wrote 1000/1000 bytes at offset 4096
1000.000000 bytes, 1 ops; 0.0001 sec (5.610 MiB/sec and 5882.3529 ops/sec)
pread: No data available

Fix this case by having netfs assume zeroes when reads from server come
short like AFS and CEPH do

Link: https://lkml.kernel.org/r/20220110111444.926753-1-asmadeus@codewreck.org
Cc: stable@vger.kernel.org
Fixes: eb497943fa ("9p: Convert to using the netfs helper lib to do reads and caching")
Co-authored-by: David Howells <dhowells@redhat.com>
Reviewed-by: David Howells <dhowells@redhat.com>
Tested-by: David Howells <dhowells@redhat.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
2022-01-11 15:21:53 +09:00
..
acl.c 9p: fix a bunch of checkpatch warnings 2021-11-04 21:04:25 +09:00
acl.h 9p: fix a bunch of checkpatch warnings 2021-11-04 21:04:25 +09:00
cache.c 9p: fix a bunch of checkpatch warnings 2021-11-04 21:04:25 +09:00
cache.h 9p: Convert to using the netfs helper lib to do reads and caching 2021-11-03 17:45:02 +09:00
fid.c fs/9p: fix indentation and Add missing a blank line after declaration 2021-11-03 17:45:03 +09:00
fid.h 9p: apply review requests for fid refcounting 2020-11-19 17:21:34 +01:00
Kconfig 9p: Convert to using the netfs helper lib to do reads and caching 2021-11-03 17:45:02 +09:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
v9fs_vfs.h 9p: fix a bunch of checkpatch warnings 2021-11-04 21:04:25 +09:00
v9fs.c 9p: fix a bunch of checkpatch warnings 2021-11-04 21:04:25 +09:00
v9fs.h fs/9p: fix warnings found by checkpatch.pl 2021-11-03 17:45:03 +09:00
vfs_addr.c 9p: fix enodata when reading growing file 2022-01-11 15:21:53 +09:00
vfs_dentry.c 9p: fix a bunch of checkpatch warnings 2021-11-04 21:04:25 +09:00
vfs_dir.c 9p: fix file headers 2021-11-03 17:45:04 +09:00
vfs_file.c 9p: Use BUG_ON instead of if condition followed by BUG. 2022-01-10 10:00:09 +09:00
vfs_inode_dotl.c 9p: only copy valid iattrs in 9P2000.L setattr implementation 2022-01-10 10:00:09 +09:00
vfs_inode.c 9p: fix a bunch of checkpatch warnings 2021-11-04 21:04:25 +09:00
vfs_super.c 9p: fix a bunch of checkpatch warnings 2021-11-04 21:04:25 +09:00
xattr.c 9p: fix file headers 2021-11-03 17:45:04 +09:00
xattr.h 9p: fix a bunch of checkpatch warnings 2021-11-04 21:04:25 +09:00