public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Peter Eisentraut <[email protected]>
Cc: Thomas Munro <[email protected]>
Cc: Robert Haas <[email protected]>
Cc: Larry Rosenman <[email protected]>
Cc: Pgsql hackers <[email protected]>
Subject: Re: Fwd: Re: A new look at old NFS readdir() problems?
Date: Fri, 03 Jan 2025 13:12:43 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <CA+hUKGJuG+P74iaVkBXBPE-rDsULjaruhiJ=qKYwbn_cpfpMQg@mail.gmail.com>
	<CAM5tNy7jFMb_zuLZddpX0dM9Cq=Ww-uVBSwS6b2AYD2bCPdbSw@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<CA+Tgmobh=vSvR4uDmPJ6Y00MptUeoPnKdx19yLpR7GpfXXnt5w@mail.gmail.com>
	<[email protected]>
	<CA+hUKG+rBEN5Z29AGHHGTaKa35nQugCQuGoOSQWGQNz=Rc8_nA@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>

Peter Eisentraut <[email protected]> writes:
> On 03.01.25 02:58, Tom Lane wrote:
>> I poked at this a little further.  I made the attached stand-alone
>> test case (you don't need any more than "cc -o rmtree rmtree.c"
>> to build it, then point the script at some NFS-mounted directory).
>> This fails with my NAS at least as far back as FreeBSD 11.0.
>> I also tried it on NetBSD 9.2 which seems fine.

> If you use some GUI file manager, point at a directory, and select 
> "remove this directory with everything in it", what does it do 
> internally?  Surely it runs a readdir() loop and unlinks the files as it 
> gets to them?  Or does it indeed slurp the whole directory tree into 
> memory before starting the deletion?

One thing I noticed while testing yesterday is that "rm -rf foo"
worked even in cases where "rmtree foo" didn't.  I did not look
into FreeBSD's rm code, but I'll bet it has the sort of retry
logic that was recommended to us upthread.  I agree with your
point though that it's hard to believe that everyone does that
in every case where it would matter.

As for pre-existing bug reports, I found

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=57696

but there's basically no new information there, other than
the not-so-surprising fact that renaming directory entries
triggers the failure as efficiently as unlinking does.

			regards, tom lane






view thread (10+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Fwd: Re: A new look at old NFS readdir() problems?
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox