Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Jan 2003 14:29:24 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Richard Sharpe <rsharpe@richardsharpe.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: What prevents there from being a race with open(...,O_CREAT  |O_EXCL,...)
Message-ID:  <3E1F4944.96F1AD23@mindspring.com>
References:  <Pine.LNX.4.33.0301101437330.2747-100000@ns.aus.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3E1F4944.96F1AD23>