summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <trondmy@gmail.com>2019-12-17 12:33:33 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-02-11 04:34:13 -0800
commit9939dffe7a5e83cfe97b41dde21507b7c7f7821e (patch)
tree6f3b789df57c1cb5f8cf5f058de8f48e99703336 /fs
parentfdbc75c7cb7535890b948b16d349bb7de0d37664 (diff)
downloadlinux-stable-9939dffe7a5e83cfe97b41dde21507b7c7f7821e.tar.gz
linux-stable-9939dffe7a5e83cfe97b41dde21507b7c7f7821e.tar.bz2
linux-stable-9939dffe7a5e83cfe97b41dde21507b7c7f7821e.zip
nfsd: Return the correct number of bytes written to the file
commit 09a80f2aef06b7c86143f5c14efd3485e0d2c139 upstream. We must allow for the fact that iov_iter_write() could have returned a short write (e.g. if there was an ENOSPC issue). Fixes: d890be159a71 "nfsd: Add I/O trace points in the NFSv4 write path" Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/vfs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 4fe8db314950..80cededcd10d 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1016,6 +1016,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
host_err = vfs_iter_write(file, &iter, &pos, flags);
if (host_err < 0)
goto out_nfserr;
+ *cnt = host_err;
nfsdstats.io_write += *cnt;
fsnotify_modify(file);