]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
NFS/localio: Handle short writes by retrying
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 3 Jan 2026 17:14:59 +0000 (12:14 -0500)
committerAnna Schumaker <anna.schumaker@oracle.com>
Thu, 22 Jan 2026 15:51:10 +0000 (10:51 -0500)
commit615762059d284b863f9163b53679d95b3dcdd495
tree9e55db9e2cc30f775cf4b51552e5cfb77d554f11
parenta13bc3286cb380aeca0d68dcb80d7611520e0b9e
NFS/localio: Handle short writes by retrying

The current code for handling short writes in localio just truncates the
I/O and then sets an error. While that is close to how the ordinary NFS
code behaves, it does mean there is a chance the data that got written
is lost because it isn't persisted.
To fix this, change localio so that the upper layers can direct the
behaviour to persist any unstable data by rewriting it, and then
continuing writing until an ENOSPC is hit.

Fixes: 70ba381e1a43 ("nfs: add LOCALIO support")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Reviewed-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
fs/nfs/localio.c