[PATCH 0/2] NFS: netfs fixes for short and redone reads
From: Josef Bacik
Date: Fri Dec 04 2026 - 17:11:08 EST
Hello,
When fscache is on, NFS does its reads through netfs, and there are two
cases where it tells netfs the wrong thing.
If a READ comes back short and NFS asks for the rest, only the last
reply is counted, so netfs takes a complete read for a short one. In
the middle of the file it fails the read, and at the end of the file it
clears data that was read. The first patch counts all of it.
A pageio header takes its netfs reference when its RPC is set up and
drops it at the end of nfs_read_completion(), and the two don't always
go together. A redone header never drops its reference, so the reader
hangs, and the block and SCSI layouts send no RPC and drop a reference
they never took. The second patch takes the reference with the header,
and passes netfs the error if sending the requests again fails.
The second patch needs the first, since a redone read now comes to an
end and its replies can be short. This is against v7.4-rc5. Thanks,
Josef
---
Josef Bacik (2):
NFS: Report all of a read done in parts to netfs
NFS: Tie the netfs reference to the pageio header
fs/nfs/fscache.c | 23 ++++++++++++-----------
fs/nfs/fscache.h | 14 ++++++++++++--
fs/nfs/pagelist.c | 2 ++
fs/nfs/read.c | 4 +---
4 files changed, 27 insertions(+), 16 deletions(-)
---
base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244
change-id: 20261204-b4-nfs-netfs-reads-1c4b6379509c