[pnfs] [PATCH 1/1] pnfsd: layoutcommit set size fix

Labiaga, Ricardo Ricardo.Labiaga at netapp.com
Wed Mar 5 18:12:53 EST 2008


Sounds good, I'll update the dprintk to include the newoffset value as
well and replace reference of __FUNCTION__ to __func__ in this function.

- ricardo

> -----Original Message-----
> From: Benny Halevy [mailto:bhalevy at panasas.com] 
> Sent: Tuesday, March 04, 2008 10:57 PM
> To: Labiaga, Ricardo
> Cc: pnfs at linux-nfs.org
> Subject: Re: [pnfs] [PATCH 1/1] pnfsd: layoutcommit set size fix
> 
> On Mar. 05, 2008, 2:01 +0200, Ricardo Labiaga 
> <ricardo.labiaga at netapp.com> wrote:
> > From: Ricardo Labiaga <Ricardo.Labiaga at netapp.com>
> > 
> > nfsd4_layoutcommit() should only reset the size of the file if
> > the client modified the file size.  The client indicates size change
> > by setting the no_newoffset field in the LAYOUT_COMMIT message.
> > 
> > Note that the 'no_' prefix stands for "new offset", not for 
> negative.
> > If no_newoffset is false while XDR decoding (no file change), we set
> > lcp->lc_newoffset to zero to indicate this.
> > 
> > Signed-off-by: Ricardo Labiaga <Ricardo.Labiaga at netapp.com>
> > ---
> >  fs/nfsd/nfs4proc.c |    3 ++-
> >  1 files changed, 2 insertions(+), 1 deletions(-)
> > 
> > diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> > index be017b2..5839c57 100644
> > --- a/fs/nfsd/nfs4proc.c
> > +++ b/fs/nfsd/nfs4proc.c
> > @@ -1098,7 +1098,8 @@ nfsd4_layoutcommit(struct svc_rqst *rqstp,
> >  		__FUNCTION__, lcp->lc_last_wr + 1, ino->i_size);
> 
> Ricardo, how about also updating the debug message and comment
> right above? (reminder: please also s/__FUNCTION__/__func__/ :)
> 
> Benny
> 
> >  
> >  	fh_lock(current_fh);
> > -	if ((lcp->lc_last_wr + 1) <= ino->i_size) {
> > +	if ((lcp->lc_newoffset == 0) ||
> > +	    ((lcp->lc_last_wr + 1) <= ino->i_size)) {
> >  		status = 0;
> >  		lcp->lc_size_chg = 0;
> >  		fh_unlock(current_fh);
> 
> 


More information about the pNFS mailing list