Skip to content

Commit

Permalink
NFS: When resending after a short write, reset the reply count to zero
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Trond Myklebust authored and Anna Schumaker committed Jan 15, 2020
1 parent e8194b7 commit 8c9cb71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/nfs/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 2 additions & 0 deletions fs/nfs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 8c9cb71

Please sign in to comment.