summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlga Kornievskaia <okorniev@redhat.com>2026-02-21 00:42:18 +0300
committerTrond Myklebust <trond.myklebust@hammerspace.com>2026-04-13 21:17:31 +0300
commit3a06bac55bf56290673ea67abe3d285f0ab3837a (patch)
tree234618569a7c1561215b1ebd5993d6fba4c7993d
parent1805e6b2f49fbf63322a629a36019cbe2c6628e3 (diff)
downloadlinux-3a06bac55bf56290673ea67abe3d285f0ab3837a.tar.xz
NFS: improve "Server wrote zero bytes" error
When a pnfs error occurs, the IO is retried against the MDS. However, the initial IO leads to the kernel logging "Serer wrote zero bytes" when in fact the MDS IO will not fail and thus the error misleads administrators that the system is experiencing issues. When pnfs IO fails which triggers pnfs_write_done_resent_to_mds() which would end up clearing nfs_pgio_header's pages structure (copying the content into a new one to do new RPC calls to the MDS). Thus, in nfs_writeback_result() when we have no pages to work with no need to try and also therefore skip logging the message about 0bytes. Fixes: 6c75dc0d498c ("NFS: merge _full and _partial write rpc_ops") Suggested-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Olga Kornievskaia <okorniev@redhat.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
-rw-r--r--fs/nfs/write.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 1ed4b3590b1a..f1f62787dd74 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1551,7 +1551,7 @@ static void nfs_writeback_result(struct rpc_task *task,
struct nfs_pgio_args *argp = &hdr->args;
struct nfs_pgio_res *resp = &hdr->res;
- if (resp->count < argp->count) {
+ if (resp->count < argp->count && !list_empty(&hdr->pages)) {
static unsigned long complain;
/* This a short write! */