diff options
author | 2019-12-17 12:33:33 -0500 | |
---|---|---|
committer | 2019-12-17 14:32:20 -0500 | |
commit | 09a80f2aef06b7c86143f5c14efd3485e0d2c139 (patch) | |
tree | a8de6d7050d8cf2b9b302e4dbc6ec45182903765 /fs/nfsd/vfs.c | |
parent | nfsd4: avoid NULL deference on strange COPY compounds (diff) | |
download | linux-09a80f2aef06b7c86143f5c14efd3485e0d2c139.tar.gz linux-09a80f2aef06b7c86143f5c14efd3485e0d2c139.tar.bz2 linux-09a80f2aef06b7c86143f5c14efd3485e0d2c139.zip |
nfsd: Return the correct number of bytes written to the file
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>
Diffstat (limited to 'fs/nfsd/vfs.c')
-rw-r--r-- | fs/nfsd/vfs.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index c0dc491537a6..f0bca0e87d0c 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -975,6 +975,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); |