Date: Thu, 15 Dec 2016 23:17:46 +0000 From: Rick Macklem <rmacklem@uoguelph.ca> To: Colin Percival <cperciva@tarsnap.com>, Benjamin Kaduk <kaduk@mit.edu> Cc: "freebsd-fs@freebsd.org" <freebsd-fs@freebsd.org> Subject: Re: ESTALE after cwd deleted by same NFS client Message-ID: <YTXPR01MB01891CB02D5D7BA46579F1BFDD9D0@YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM> In-Reply-To: <YTXPR01MB0189ACD940B7D399A6855CB8DD9A0@YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM> References: <01000158f023675b-41b35a73-4428-4937-853b-62db4fb9b984-000000@email.amazonses.com> <20161212054233.GU8460@kduck.kaduk.org> <01000158f1abc081-d4eddc58-3b4b-41dd-aa1e-0157d2fad812-000000@email.amazonses.com> <20161212163603.GV8460@kduck.kaduk.org> <YQBPR01MB018054EE62DEFDC73784AD9BDD9B0@YQBPR01MB0180.CANPRD01.PROD.OUTLOOK.COM>, <01000158fc3da2c5-c13da088-e7b9-4ac0-ac01-ec49a275dd24-000000@email.amazonses.com>, <YTXPR01MB0189ACD940B7D399A6855CB8DD9A0@YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM>
next in thread | previous in thread | raw e-mail | index | archive | help
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 follo= wing simple change: (I'll just explain the patch, since I don't have sources han= dy) In sys/fs/nfsclient/nfs_clvnops.c: Line #s 1678, 1679 (for remove) and 2180, 2181 (for rmdir) look like: if (error =3D=3D ENOENT) error =3D 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 =3D=3D ENOENT || error =3D=3D ESTALE) error =3D 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YTXPR01MB01891CB02D5D7BA46579F1BFDD9D0>