ESTALE after cwd deleted by same NFS client
Rick Macklem
rmacklem at uoguelph.ca
Fri Dec 16 02:51:05 UTC 2016
Colin Percival wrote:
>On 12/13/16 05:04, Rick Macklem wrote:
>>>>> On Sun, Dec 11, 2016 at 11:06:42PM +0000, Colin Percival wrote:
>>>>>> 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
>> If this is happening on a single client
>
>Yes. At the time I ran this, there was only one client.
>
I will try and play with this when I get home, but you could test the following
simple change: (I'll just explain the patch, since I don't have sources handy)
In sys/fs/nfsclient/nfs_clvnops.c:
Line #s 1678, 1679 (for remove) and 2180, 2181 (for rmdir) look like:
if (error == ENOENT)
error = 0;
This is done since, if it doesn't exist, it has been "removed".
It seems to me that ESTALE means it has been removed too.
(Actually the directory the name was in has been removed, but that implies that
the name is gone too.)
You could try changing the code at 1678 and 2180 to:
if (error == ENOENT || error == ESTALE)
error = 0;
and see if that "fixes" the problem. (This hack has existed in the code for a long
time and changing it to also do ESTALE seems reasonable to me.)
If this doesn't fix it, then it might be "do sillyrename for directories", but that
is a more significant (I might call it scarier) change.
Have fun with it, rick
More information about the freebsd-fs
mailing list