[Top] [All Lists]

Re: [xfs-masters] [PATCH] xfs: failure mapping nfs fh to inode should re

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [xfs-masters] [PATCH] xfs: failure mapping nfs fh to inode should return ESTALE
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Sat, 16 Jul 2011 11:50:14 +1000
Cc: "J. Bruce Fields" <bfields@xxxxxxxxxxxx>, xfs-masters@xxxxxxxxxxx, linux-nfs@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx
In-reply-to: <20110714223126.GA28694@xxxxxxxxxxxxx>
References: <20110714205036.GA19457@xxxxxxxxxxxx> <20110714223126.GA28694@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
On Thu, Jul 14, 2011 at 06:31:26PM -0400, Christoph Hellwig wrote:
> On Thu, Jul 14, 2011 at 04:50:36PM -0400, J. Bruce Fields wrote:
> > From: J. Bruce Fields <bfields@xxxxxxxxxx>
> > 
> > On xfs exports, nfsd is incorrectly returning ENOENT instead of ESTALE
> > on attempts to use a filehandle of a deleted file (spotted with pynfs
> > test PUTFH3).  The ENOENT was coming from xfs_iget.
> With that you mean the ip->i_d.di_mode checks?  Given that we should
> only be bale to get these from NFS or the handle ioctls I suspect just
> turning them into ESTALE should be fine.

Bulkstat also checks for ENOENT returns from xfs_iget() as the
lookup it does is inherently racy. That is, if the inode is
allocated when it is read from the IBT, but then has been unlinked
before the actual xfs_iget() call, it expects to get back an ENOENT
to tell it the inode has been unlinked and shouldn't be included in
the bulkstat output. Otherwise, it returns the error to userspace.

So converting the mode checks to return ESTALE definitely has the
chance of breaking stuff that uses bulkstat (e.g. xfsdump) because
it will return errors now where it previously just skipped the
(unlinked) inode.


Dave Chinner

<Prev in Thread] Current Thread [Next in Thread>