From owner-freebsd-hackers Wed Feb 7 17:34: 1 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from gw.gbch.net (gw.gbch.net [203.24.22.66]) by hub.freebsd.org (Postfix) with SMTP id D7D6F37B69B for ; Wed, 7 Feb 2001 17:33:40 -0800 (PST) Received: (qmail 53022 invoked by uid 1001); 8 Feb 2001 11:33:37 +1000 X-Posted-By: GJB-Post 2.12 07-Feb-2001 X-Operating-System: FreeBSD 4.1-RELEASE i386 X-URL: http://www.gbch.net/gjb/ X-Image-URL: http://www.gbch.net/gjb/img/gjb-auug048.gif X-PGP-Fingerprint: 5A91 6942 8CEA 9DAB B95B C249 1CE1 493B 2B5A CE30 X-PGP-Public-Key: http://www.gbch.net/gjb/gjb-pgpkey.asc Message-Id: Date: Thu, 08 Feb 2001 11:33:36 +1000 From: Greg Black To: Alfred Perlstein Cc: mouss , Tony Finch , Andre Oppermann , Matt Dillon , Rik van Riel , Mike Silbersack , Poul-Henning Kamp , Charles Randall , Dan Phoenix , Jos Backus , freebsd-hackers@FreeBSD.ORG Subject: Re: soft updates and qmail (RE: qmail IO problems) References: <20010207110208.G74296@hand.dotat.at> <3A805035.C71AAD5E@monzoon.net> <200102061943.f16Jhp365113@earth.backplane.com> <3A805938.96ED890D@monzoon.net> <20010207110208.G74296@hand.dotat.at> <4.3.0.20010207142937.045be410@pop.free.fr> <20010207151647.T26076@fw.wintelcom.net> In-reply-to: <20010207151647.T26076@fw.wintelcom.net> of Wed, 07 Feb 2001 15:16:47 PST Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Alfred Perlstein wrote: > * Greg Black [010207 13:05] wrote: > > mouss wrote: > > > > > At 21:25 07/02/01 +1000, Greg Black wrote: > > > >Tony Finch wrote: > > > > > > > > > Why not just use rename(2)? To protect against the new filename > > > > > already existing? > > > > > > > >Why not just read the man page for rename(2) before making > > > >suggestions? > > > > > > I find nothing convincing in the manpage. Could you please tell > > > what I am missing. > > > > Read the man page, and concentrate on the second sentence under > > the Description heading. > > I'm not sure if the same problem exists for link/unlink and if > the problem applies to files (not just directories), but there's > a per-FS flag "in-rename" that prevents concurrant rename(2)s on > the same FS to prevent a race where something like this can happen: > > /a/b/c > > /x/y/z > > move /a/b to /x/y and at the same time try to move /x/y to /a/b. You can't rename /a/b to /x/y or /x/y to /a/b in this situation: the destination must be empty if it's a directory and you refer to /a/b/c and /x/y/z. RTFM rename(2). To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message