OSDN Git Service

NFS: When resending after a short write, reset the reply count to zero
authorTrond Myklebust <trondmy@gmail.com>
Mon, 6 Jan 2020 20:25:13 +0000 (15:25 -0500)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 15 Jan 2020 15:54:33 +0000 (10:54 -0500)
If we're resending a write due to a short read or write, ensure we
reset the reply count to zero.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/read.c
fs/nfs/write.c

index 12deb3b..34bb9ad 100644 (file)
@@ -281,6 +281,8 @@ static void nfs_readpage_retry(struct rpc_task *task,
        argp->offset += resp->count;
        argp->pgbase += resp->count;
        argp->count -= resp->count;
+       resp->count = 0;
+       resp->eof = 0;
        rpc_restart_call_prepare(task);
 }
 
index 83f92a4..c478b77 100644 (file)
@@ -1658,6 +1658,8 @@ static void nfs_writeback_result(struct rpc_task *task,
                         */
                        argp->stable = NFS_FILE_SYNC;
                }
+               resp->count = 0;
+               resp->verf->committed = 0;
                rpc_restart_call_prepare(task);
        }
 }