ESTALE after cwd deleted by same NFS client
Benjamin Kaduk
kaduk at mit.edu
Mon Dec 12 05:47:51 UTC 2016
On Sun, Dec 11, 2016 at 11:06:42PM +0000, Colin Percival wrote:
> Hi filesystem gurus,
>
> If I run the following with /nfs/ being an NFS mount:
> # mkdir /nfs/foo
> # touch /nfs/foo/bar
> # cd /nfs/foo
> # rm -r /nfs/foo
> # rm bar
>
> Then the final 'rm bar' fails with 'Stale NFS file handle'. This results
> in 'make buildworld' with an NFS-backed /usr/obj failing during cleandir
> (which, for some reason, seems to delete the same directories multiple
> times.)
>
> I'm not sure if this is an NFS issue or a VFS issue, nor whether this is
> intended (but IMHO astonishing) behaviour or a bug.
>
> I realize that if the 'rm -r' was performed by a different NFS client, this
> is the behaviour which would be expected; but it seems to me that when the
> commands are executed by the same NFS client, it should be possible for the
> cached file handle for /nfs/foo to be invalidated when /nfs/foo is deleted,
> in order to return ENOENT instead of ESTALE here.
Amusingly, this just came up recently:
https://www.ietf.org/mail-archive/web/nfsv4/current/msg15115.html (et seq)
But I guess you did not specify which version of the NFS protocol you were
using...
-Ben
More information about the freebsd-fs
mailing list