delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/01/26/09:59:46

X-Spam-Check-By: sourceware.org
Message-ID: <81b0412b0601260659n2b611624l77fa4513be9f8f09@mail.gmail.com>
Date: Thu, 26 Jan 2006 15:59:33 +0100
From: Alex Riesen <raa DOT lkml AT gmail DOT com>
To: Eric Blake <ericblake AT comcast DOT net>
Subject: Re: cygwin-1.5.19-2: mkdir returns inconsistent errno
Cc: cygwin AT cygwin DOT com
In-Reply-To: <012620061433.15133.43D8DDB80001B6F600003B1D22069997350A050E040D0C079D0A@comcast.net>
MIME-Version: 1.0
References: <012620061433 DOT 15133 DOT 43D8DDB80001B6F600003B1D22069997350A050E040D0C079D0A AT comcast DOT net>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
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
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id k0QExjNJ008863

On 1/26/06, Eric Blake <ericblake AT comcast DOT net> wrote:
> > mkdir (also syscall) return "Permission denied" when its argument refers to
> > a mountpoint  at the top of windows drive (probably also a windows mount,
> > I haven't tried).
> > For example:
> > $ mount d: /d
> > $ mkdir /
> > mkdir: cannot create directory `/': File exists
> > $ mkdir /d
> > mkdir: cannot create directory `/d': Permission denied
> > $ mkdir /d/tmp
> > mkdir: cannot create directory `/d/tmp': File exists
>
> I raised this issue before, and the conclusion was that
> POSIX permits this behavior (the mkdir must fail, but
> is permitted to fail for ANY of the permissible errno
> values that apply to the situation when more than
> one failure mode is present).  Therefore, it is highly
> likely that no change will be made to cygwin.

Pity.

> > This is highly unexpected, does not match linux behaviour (it returns EEXIST),
> > and actually breaks git (git clone, creation of pathnames, to be precise).
>
> Then git has a bug.  Report it there.  To be portable
> when making pathnames, you must first check
> for directory existance rather than relying on an
> errno of EEXIST to tell you the directory exists.

How do you do it race-free?

No, I don't think it is a bug in git, or in any code which
expects EEXIST from mkdir in case an entry actually
just plain does exist.

> This is not even cygwin-specific.  It is possible on
> Linux to have /usr mounted on a read-only filesystem,
> then /usr/local mounted in a writable location,
> such that the call "mkdir -p /usr/local/dir" will get
> EROFS on the /usr component rather than EEXIST
> (trust me - the coreutils code for mkdir faced this
> very same issue in 5.90, and was fixed in time for
> the current 5.93).

Are you sure? Linux 2.6.15. It correctly reports EEXIST
on /usr and /usr/local and creates /usr/local/dir.
I'd consider that a bug, if it were otherwise. The reason
of racing alone if enough.

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