delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/08/22/14:50:16

X-Spam-Check-By: sourceware.org
Message-ID: <44EB51D5.5060900@byu.net>
Date: Tue, 22 Aug 2006 12:49:57 -0600
From: Eric Blake <ebb9 AT byu DOT net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.5) Gecko/20060719 Thunderbird/1.5.0.5 Mnenhy/0.7.4.666
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: coreutils 5.97; mkdir -p; mkdir: cannot create directory `name': File exists
References: <44EB471A DOT 3080400 AT Sun DOT COM>
In-Reply-To: <44EB471A.3080400@Sun.COM>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

-----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.

- --
Life is short - so eat dessert first!

Eric Blake             ebb9 AT byu DOT net
volunteer cygwin coreutils maintainer
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE61HV84KuGfSFAYARAiB+AJ44hlkTkvIbrXQhqB9/E8HaF7neMwCfeke/
491C9NVNTutnL4Ds1pVXygs=
=Fdu4
-----END PGP SIGNATURE-----

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019