pnfs: improve "Server wrote zero bytes" error
Subsystems (2)
Olga Kornievskaia
reviewerPATCH 1/1 pnfs: 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.
Instead, recognize that a re-try-against-MDS type of error has occuried before printing the "Server wrote zero bytes" warning.
--- fs/nfs/filelayout/filelayout.c | 1 + fs/nfs/write.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
fs/nfs/filelayout/filelayout.c +1 -0
@@ -323,6 +323,7 @@ static int filelayout_write_done_cb(struct rpc_task *task,switch (err) {case -NFS4ERR_RESET_TO_MDS : + hdr->pnfs_error = task->tk_status;filelayout_reset_write (hdr);return task->tk_status;case -EAGAIN :
fs/nfs/write.c +1 -1
@@ -1558,7 +1558,7 @@ static void nfs_writeback_result(struct rpc_task *task,nfs_inc_stats (hdr->inode,NFSIOS_SHORTWRITE );/* Has the server at least made some progress? */ -if (resp->count ==0 ) { +if (resp->count ==0 && !hdr->pnfs_error) {if (time_before (complain, jiffies)) { printk(KERN_WARNING "NFS: Server wrote zero bytes, expected %u.\n",
Signature · 1 line
2.52.0
Hi Olga,
Quoted 39 lines · Olga Kornievskaia
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.
Instead, recognize that a re-try-against-MDS type of error has occuried before printing the "Server wrote zero bytes" warning.
Signed-off-by Olga Kornievskaia <[email protected]>---
fs/nfs/filelayout/filelayout.c | 1 +
fs/nfs/write.c | 2 +-2 files changed, 2 insertions(+), 1 deletion(-)fs/nfs/filelayout/filelayout.c +0
-0@@ -323,6 +323,7 @@ static int filelayout_write_done_cb(struct rpc_task *task,
switch (err) {
case -NFS4ERR_RESET_TO_MDS:fs/nfs/filelayout/filelayout.c +1
-0+ hdr->pnfs_error = task->tk_status;
filelayout_reset_write(hdr);
returntask->tk_status;
case-EAGAIN:fs/nfs/write.c +0
-0@@ -1558,7 +1558,7 @@ static void nfs_writeback_result(structrpc_task *task, nfs_inc_stats(hdr->inode, NFSIOS_SHORTWRITE);
/* Has the server at least made some progress? */fs/nfs/write.c +1
-1-if (resp->count ==0 ) { +if (resp->count ==0 && !hdr->pnfs_error) {
Quoted 4 lines
if (
time_before(complain, jiffies)) { printk(KERN_WARNING "NFS: Server wrote zero bytes, expected %u.\n",
Hmm... Is this needed? Shouldn't the test for task->tk_status < 0 in nfs_pgio_result() ensure that we can't call nfs_writeback_result() in the above case?
Signature · 3 lines
Trond Myklebust Linux NFS client maintainer, Hammerspace [email protected], [email protected]
Quoted 40 lines · Trond Myklebust
Hi Olga,
Quoted 36 lines · Olga Kornievskaia
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.
Instead, recognize that a re-try-against-MDS type of error has occuried before printing the "Server wrote zero bytes" warning.
Signed-off-by Olga Kornievskaia <[email protected]>--- fs/nfs/filelayout/filelayout.c | 1 + fs/nfs/write.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)fs/nfs/filelayout/filelayout.c +1
-0@@ -323,6 +323,7 @@ static int filelayout_write_done_cb(struct rpc_task *task, switch (err) {case -NFS4ERR_RESET_TO_MDS : + hdr->pnfs_error = task->tk_status;filelayout_reset_write (hdr);return task->tk_status;case
-EAGAIN:fs/nfs/write.c +0
-0@@ -1558,7 +1558,7 @@ static void nfs_writeback_result(struct rpc_task *task,nfs_inc_stats (hdr->inode,NFSIOS_SHORTWRITE );
Quoted 9 lines
Quoted 7 lines
fs/nfs/write.c +1
-1/* Has the server at least made some progress? */ -if (resp->count ==0 ) { +if (resp->count ==0 && !hdr->pnfs_error) {if (time_before (complain, jiffies)) { printk(KERN_WARNING"NFS: Server wrote zero
bytes, expected %u.\n",Hmm... Is this needed? Shouldn't the test for
task->tk_status< 0 in
task_status is 0 when it gets to nfs_writeback_done because in filelayout/filelayout.c in filelayout_reset_write() is doing this
task->tk_status = pnfs_write_done_resend_to_mds(hdr);
Quoted 7 lines
nfs_pgio_result()ensure that we can't callnfs_writeback_result()in the above case?--
Trond Myklebust
Linux NFS client maintainer, Hammerspace [email protected], [email protected]
Trond Myklebust
maintainerQuoted 14 lines · Olga Kornievskaia
Quoted 3 lines · Trond Myklebust
Hmm... Is this needed? Shouldn't the test for
task->tk_status< 0 in
task_statusis 0 when it gets tonfs_writeback_donebecause infilelayout/filelayout.cinfilelayout_reset_write()is doing this
task->tk_status=pnfs_write_done_resend_to_mds(hdr);Quoted 3 lines
nfs_pgio_result()ensure that we can't callnfs_writeback_result()in
the above case?
Oh... So isn't the hdr->pages list actually empty? Should we even bother entering the short write condition when that happens?
IOW: Why not just change that test at the top of nfs_writeback_result() to read something like
if (resp->count < argp->count && !list_empty(hdr->pages)) {Signature · 3 lines
Trond Myklebust Linux NFS client maintainer, Hammerspace [email protected], [email protected]
Quoted 17 lines · Trond Myklebust
Quoted 14 lines · Olga Kornievskaia
Quoted 3 lines · Trond Myklebust
Hmm... Is this needed? Shouldn't the test for
task->tk_status< 0 in
task_statusis 0 when it gets tonfs_writeback_donebecause infilelayout/filelayout.cinfilelayout_reset_write()is doing this
task->tk_status=pnfs_write_done_resend_to_mds(hdr);Quoted 3 lines
nfs_pgio_result()ensure that we can't callnfs_writeback_result()in
the above case?
Quoted 7 lines
Oh... So isn't the
hdr->pageslist actually empty? Should we even bother entering the short write condition when that happens?IOW: Why not just change that test at the top of
nfs_writeback_result()to read something likeif (resp->count < argp->count && !list_empty(hdr->pages)) {
Thank you for the suggestion. A generic approach like you are suggesting is definitely better. I have tested it and it solves the problem. I can send a v2 tomorrow.
Quoted 7 lines
--
Trond Myklebust
Linux NFS client maintainer, Hammerspace [email protected], [email protected]