Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 19d1c326 authored by Dominique Martinet's avatar Dominique Martinet
Browse files

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: eb497943

 ("9p: Convert to using the netfs helper lib to do reads and caching")
Co-authored-by: default avatarDavid Howells <dhowells@redhat.com>
Reviewed-by: default avatarDavid Howells <dhowells@redhat.com>
Tested-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarDominique Martinet <asmadeus@codewreck.org>
parent 15e2721b
Branches
Tags
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment