Subject: bug#7389: rename() over NFS

From: Jim Meyering <[email-masked]>
Date: Sat, 13 Nov 2010 13:11:41 +0100

Bruno Haible wrote:
> [bug-coreutils readers: This is a reply to
>  <http://lists.gnu.org/archive/html/bug-gnulib/2010-11/msg00155.html>].
>
> Paul Eggert wrote:
>> > What should we do?
>> >   a) Patch the test so that it uses a readdir() loop to detect the absence of
>> >      the file even when stat() pretends it's still present. Or
>> >   b) Use an rpl_rename override that will make the unit test work.
>>
>> It's long been well-known that NFS is not POSIX-compliant.
>> If we start down the path of putting wrappers around NFS to make it
>> POSIX-compliant,
>> we'll have a lot of work to do and a job that will probably never end,
>> and we'll make coreutils slow down for the common case even though
>> in practice the problems are rare and users don't care about them.
>>
>> So, my vote is for (a).  Or maybe even (c): skip the test if it's
>> running atop NFS.
>>
>> I've been observing similar test failures for months, by the way, but
>> haven't bothered to report them, because, hey! it's NFS! of course it's
>> going to screw up in those cases!
>
> But NFS is widely used, in small networks of 2 to 50 Linux/Unix machines.
> Users are running shell scripts in such situations, with lots of coreutils
> commands.

Hi Bruno,

Rename is fundamental enough and such NFS-specific problems rare enough
that I would prefer not to impose a rename wrapper on everyone.  I agree
with Paul that this is a very steep slippery slope.  If we start down
it in earnest, we may end up making our tools less maintainable in the
long run, and for only very marginal benefit.

However, if you see ways to improve things without impacting performance
or maintainability, I'm all for it.