Re: [PATCH] NFSv4: Fix sillyrename to return the delegation when appropriate

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

 



On Tue, 2018-05-29 at 14:33 -0400, Anna Schumaker wrote:
> Hi Trond,
> 
> On 05/29/2018 11:48 AM, Trond Myklebust wrote:
> > If the file being sillyrenamed is being completely deleted, or
> > we are using NFSv4.0, then we need to return the delegation before
> > sending off the sillydelete.
> > 
> > Signed-off-by: Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx>
> > ---
> >  fs/nfs/dir.c | 23 ++++++++++++++++++++++-
> >  1 file changed, 22 insertions(+), 1 deletion(-)
> > 
> > diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
> > index b315f53b3aec..ed20ff51f865 100644
> > --- a/fs/nfs/dir.c
> > +++ b/fs/nfs/dir.c
> > @@ -1399,11 +1399,32 @@ EXPORT_SYMBOL_GPL(nfs_lookup);
> >  #if IS_ENABLED(CONFIG_NFS_V4)
> >  static int nfs4_lookup_revalidate(struct dentry *, unsigned int);
> >  
> > +/*
> > + * Called when the dentry loses inode.
> > + * We use it to clean up silly-renamed files.
> > + */
> > +static void nfs4_dentry_iput(struct dentry *dentry, struct inode
> > *inode)
> > +{
> > +	if (S_ISDIR(inode->i_mode))
> > +		/* drop any readdir cache as it could easily be
> > old */
> > +		NFS_I(inode)->cache_validity |=
> > NFS_INO_INVALID_DATA;
> > +
> > +	if (dentry->d_flags & DCACHE_NFSFS_RENAMED) {
> > +		if (inode->i_nlink == 1)
> > +			nfs4_inode_return_delegation(inode);
> > +		else
> > +			nfs4_inode_make_writeable(inode);
> 
> I think these functions need to be exported in delegation.c to avoid
> undefined symbol warnings from the compiler.
> 

Whoops. Yes, thanks for noticing!

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@xxxxxxxxxxxxxxx

��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥




[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