summaryrefslogtreecommitdiff
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2019-08-27 14:03:28 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-21 08:12:51 +0300
commitc8030f7553bcef7cdadae246a90a6395e86cde1d (patch)
tree63006d770eb01d1113d59ce4cc0e479d5b839177 /fs/nfs
parentccc4f53a7d4576d25e96dfaa9b9a902f0755d08c (diff)
downloadlinux-c8030f7553bcef7cdadae246a90a6395e86cde1d.tar.xz
NFSv2: Fix write regression
[ Upstream commit d33d4beb522987d1c305c12500796f9be3687dee ] Ensure we update the write result count on success, since the RPC call itself does not do so. Reported-by: Jan Stancek <jstancek@redhat.com> Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Tested-by: Jan Stancek <jstancek@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/proc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index 80ecdf2ec8b6..b83e14ad13c4 100644
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -610,8 +610,10 @@ static int nfs_proc_pgio_rpc_prepare(struct rpc_task *task,
static int nfs_write_done(struct rpc_task *task, struct nfs_pgio_header *hdr)
{
- if (task->tk_status >= 0)
+ if (task->tk_status >= 0) {
+ hdr->res.count = hdr->args.count;
nfs_writeback_update_inode(hdr);
+ }
return 0;
}