Re: [PATCH] nfsd: Return the correct number of bytes written to the file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 17, 2019 at 08:51:20PM +0000, Trond Myklebust wrote:
> On Tue, 2019-12-17 at 14:30 -0500, J. Bruce Fields wrote:
> > On Tue, Dec 17, 2019 at 12:33:33PM -0500, Trond Myklebust wrote:
> > > We must allow for the fact that iov_iter_write() could have
> > > returned
> > > a short write (e.g. if there was an ENOSPC issue).
> > 
> > Thanks!  Just a nit:
> > 
> > > Fixes: 73da852e3831 ("nfsd: use vfs_iter_read/write")
> > 
> > I think that should be d890be159a71 "nfsd: Add I/O trace points in
> > the
> > NFSv4 write path".
> 
> Fair enough. Do you want to fix that up?

I've taken care of it.--b.

> 
> > 
> > --b.
> > 
> > > Signed-off-by: Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx>
> > > ---
> > >  fs/nfsd/vfs.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > 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);
> > >  
> > > -- 
> > > 2.23.0
> > > 
> -- 
> Trond Myklebust
> Linux NFS client maintainer, Hammerspace
> trond.myklebust@xxxxxxxxxxxxxxx
> 
> 




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux