diff mbox series

[14/15] NFS: When resending after a short write, reset the reply count to zero

Message ID 20200106202514.785483-15-trond.myklebust@hammerspace.com (mailing list archive)
State New, archived
Headers show
Series Various writeback related fixes | expand

Commit Message

Trond Myklebust Jan. 6, 2020, 8:25 p.m. UTC
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>
---
 fs/nfs/read.c  | 2 ++
 fs/nfs/write.c | 2 ++
 2 files changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 12deb3bdb2a0..34bb9add2302 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -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);
 }
 
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 985ddff46051..2c2020546e24 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1656,6 +1656,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);
 	}
 }