From: Trond Myklebust Date: Tue, 27 Aug 2019 11:03:28 +0000 (-0400) Subject: NFSv2: Fix write regression X-Git-Tag: v4.9.194~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=15c6f86c34aaf8996dbcea4662da6d6736f77577;p=platform%2Fkernel%2Flinux-amlogic.git 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 Reported-by: Naresh Kamboju Signed-off-by: Trond Myklebust Tested-by: Jan Stancek Signed-off-by: Sasha Levin --- diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c index f3e8bcbd29a0..06e72229be12 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; }