From owner-freebsd-hackers Fri Jan 10 14:36:31 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F172937B401 for ; Fri, 10 Jan 2003 14:36:30 -0800 (PST) Received: from badboy.mail.pas.earthlink.net (badboy.mail.pas.earthlink.net [207.217.120.20]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2007243F13 for ; Fri, 10 Jan 2003 14:36:30 -0800 (PST) (envelope-from tlambert2@mindspring.com) Received: from stork (stork.mail.pas.earthlink.net [207.217.120.188]) by badboy.mail.pas.earthlink.net (8.11.6+Sun/8.11.6) with ESMTP id h0AMUrk09465 for ; Fri, 10 Jan 2003 14:30:53 -0800 (PST) Received: from pool0128.cvx21-bradley.dialup.earthlink.net ([209.179.192.128] helo=mindspring.com) by stork with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 18X7fm-0000hM-00; Fri, 10 Jan 2003 14:30:43 -0800 Message-ID: <3E1F4944.96F1AD23@mindspring.com> Date: Fri, 10 Jan 2003 14:29:24 -0800 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Richard Sharpe Cc: freebsd-hackers@freebsd.org Subject: Re: What prevents there from being a race with open(...,O_CREAT |O_EXCL,...) References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a4cadbc3213382efa9eef8f8a4c9c62625350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Richard Sharpe wrote: > In looking at vn_open, I see that it calls namei and then a little while > later calls VOP_CREATE. > > If the user did open(..., ... O_CREAT | O_EXCL, ...), what prevents a race > where one process discovers that the name doesn't already exist but > another gets in and creates the name? The directory vnode is locked over the create operation. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message