public inbox for cygwin-talk@cygwin.com
 help / color / mirror / Atom feed
* Re: "rm -rf ./foo/" safe to use?
       [not found] <20060426102623316.00000003124@DOA56811>
@ 2006-04-29 22:49 ` Eric Blake
  0 siblings, 0 replies; only message in thread
From: Eric Blake @ 2006-04-29 22:49 UTC (permalink / raw)
  To: cygwin-talk

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[thread TITTTL'd]

According to Ross, George - DOA on 4/26/2006 9:26 AM:
> A few years ago, I came across a "rm -rf" problem with NFSv2 and NFSv3 clients. NFS clients on Solaris 8 and 9, AIX 4.3, and the Hummingbird on Windows all had a problem with "rm -rf", against a certain NFS server. 
> 
> The problem was an NFS protocol implementation short-cut.  When reported, one of the vendors fixed the problem, others did not. 

And that bug is still in the wild.  The bug is that when you traverse a
directory with readdir(), while calling unlink() on the entries, that
buggy NFS servers quit at 256 files even if there are more in the
directory.  Hence, coreutils has a workaround that every 256 deleted
files, on platforms known to have buggy readdir(), rm must rewind the
directory to be sure that EVERYTHING got deleted (of course, the
workaround involves more syscalls, and is less efficient, so it is avoided
when possible).

But at least it happened to be the kind of bug you generally like (if
there is such a thing) - it misbehaved, but did not corrupt data; and you
could repeatedly run 'rm -rf' until everything finally DID disappear,
because each run successfully unlinked the next 256 entries.  It would
have been much worse if when deleting a requested file, NFS also deleted
unrequested files.

- --
Life is short - so eat dessert first!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEU+1384KuGfSFAYARAjlhAJ9pNCyofBNTaVJFXwr6QRLM6lmf8gCfTBmH
ELwE5fZ6YW2BggjSm90XQKE=
=Rmms
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-04-29 22:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20060426102623316.00000003124@DOA56811>
2006-04-29 22:49 ` "rm -rf ./foo/" safe to use? Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).