ESTALE after cwd deleted by same NFS client

Colin Percival cperciva at tarsnap.com
Thu Dec 22 00:24:43 UTC 2016


On 12/21/16 14:43, Rick Macklem wrote:
>> On 12/20/16 19:25, Don Lewis wrote:
>>> It sort of seems like this should be handled at the vfs level.  Once
>>> rmdir() succeeds, there should be no calls to the underlying fs code.
>>> Maybe add a deleted flag to the vnode ...
>>
> As I already mentioned to Colin, there is also the case where another client did the
> "rmdir" and the ESTALE will happen for that case, so mapping ESTALE->ENOENT
> seems to me to be a simple (and maybe more general) solution for NFS.

Except that ENOENT means "the named file does not exist", and ESTALE simply
means "the file which had that name a while ago no longer exists".  If you
have one machine which calls open("foo") and another machine which calls
rename("bar", "foo") then you can very reasonably expect to not get ENOENT.

It seems to me that "behave like a local filesystem with respect to other
operations from the same client, but return ESTALE if a different client
rips files/directories out from underneath you" makes more sense than having
ENOENT get returned when there is in fact a file with the specified name.

-- 
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid


More information about the freebsd-fs mailing list