From: Trond Myklebust trondmy@gmail.com
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 Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- fs/nfsd/vfs.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 4fe8db3..80ceded 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -1016,6 +1016,7 @@ static int wait_for_concurrent_writes(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);