From owner-freebsd-hackers Mon Feb 26 14:18:54 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from orthanc.ab.ca (207-167-15-66.dsl.worldgate.ca [207.167.15.66]) by hub.freebsd.org (Postfix) with ESMTP id A325037B4EC for ; Mon, 26 Feb 2001 14:18:51 -0800 (PST) (envelope-from lyndon@orthanc.ab.ca) Received: from orthanc.ab.ca (localhost [127.0.0.1]) by orthanc.ab.ca (8.11.2/8.11.2) with ESMTP id f1QMITq95167; Mon, 26 Feb 2001 15:18:29 -0700 (MST) (envelope-from lyndon@orthanc.ab.ca) Message-Id: <200102262218.f1QMITq95167@orthanc.ab.ca> From: Lyndon Nerenberg Organization: The Frobozz Magic Homing Pigeon Company To: seebs@plethora.net (Peter Seebach) Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Is mkdir guaranteed to be 'atomic' ?? In-reply-to: Your message of "Mon, 26 Feb 2001 16:01:28 CST." <200102262201.f1QM1S620699@guild.plethora.net> Date: Mon, 26 Feb 2001 15:18:29 -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >>>>> "Peter" == Peter Seebach writes: Peter> Well, imagine a hypothetical broken system in which two Peter> simultaneous calls to mkdir, on some hypothetical broken Peter> filesystem, can each think that it "succeeded". After all, Peter> at the end of the operation, the directory has been Peter> created, so who's to say they're wrong? ;) "They" are :-) What if the two processes issuing mkdir() have a different effective [ug]id or umask? I.e. if I get success back I'm going to assume I own the directory, which has a 1/n chance of being wrong for for n processes with unique uids racing a non-atomic mkdir() call over (say) NFS. --lyndon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message