X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
From: Rolf Campbell <thats.unpossible@gmail.com>
Subject:  Re: coreutils 5.97; mkdir -p; mkdir: cannot create directory `name':    File exists
Date:  Tue, 22 Aug 2006 16:23:52 -0400
Lines: 24
Message-ID: <ecfp4o$acb$1@sea.gmane.org>
References:  <44EB471A.3080400@Sun.COM> <44EB51D5.5060900@byu.net>
Mime-Version:  1.0
Content-Type:  text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding:  7bit
User-Agent: Thunderbird 3.0a1 (Windows/20060822)
In-Reply-To: <44EB51D5.5060900@byu.net>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Eric Blake wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> From: Rolf Campbell
>> I believe there is a race-condition in "mkdir -p".  Specifically, if the
>> directory does not exist *yet* when stat is called on line #98 of
>> "coreutils-5.97/lib/mkdir-p.c", but the directory *does* exist by the
>> time line #190 of the same file calls mkdir(), then the program will
>> error with "File exists".
>>
>> I hit this occasionally when doing parallel builds.
> 
> Are you sure you have the right line numbers?  The cygwin version of
> lib/mkdir-p.c is patched in coreutils-5.97-1; but even the upstream
> version takes great pains that this is not a race - yes, the directory can
> be created between the time it is statted and the mkdir, but the mkdir
> takes this into account by trying to chdir into the directory on failure,
> before giving up with an error message to the user that the file exists.
> 
> I will need a stronger argument to believe that there is a race, in which
> case, the upstream maintainers would probably like to hear it too.

Oops, after closer inspection, the problem was with my makefile. *sigh*


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

