]> git.baikalelectronics.ru Git - kernel.git/commitdiff
nfsd: Return the correct number of bytes written to the file
authorTrond Myklebust <trondmy@gmail.com>
Tue, 17 Dec 2019 17:33:33 +0000 (12:33 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Tue, 17 Dec 2019 19:32:20 +0000 (14:32 -0500)
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: e45217b85601 "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>
fs/nfsd/vfs.c

index c0dc491537a69f4271b235e46e583bbb3924e0fc..f0bca0e87d0c4f7df43871daa851c4af75dd55b0 100644 (file)
@@ -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);