git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Thomas Glanzmann <sithglan@stud.uni-erlangen.de>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH] Do _not_ call unlink on a directory
Date: Mon, 16 Jul 2007 12:58:14 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.0.999.0707161252330.20061@woody.linux-foundation.org> (raw)
In-Reply-To: <11846059721204-git-send-email-sithglan@stud.uni-erlangen.de>



On Mon, 16 Jul 2007, Thomas Glanzmann wrote:
>
> Calling unlink on a directory on a Solaris UFS filesystem as root makes it
> inconsistent. Thanks to Johannes Sixt for the obvious fix.

Ack, I think this is the right thing to do.

As pointed out, it doesn't _guarantee_ that git won't call "unlink()" on a 
directory (race conditions etc), but that's fundamentally true (there is 
no "funlink()" like there is "fstat()"), and besides, that is in no way 
git-specific (ie it's true of *any* application that gets run as root).

The theoretical race would only happen if somebody on purpose tries to 
screw things over, it would never happen under any reasonable usage. 

The old ordering of those tests was designed for sane operating systems, 
so that you could basically do the unlink() without bothering, but 
switching the order around is certainly not a disaster either, and if it 
avoids the nasty bug in Solaris it's worth doing.

I have to say that I'm still a bit shocked that Solaris would have that 
kind of behaviour. And they call that pile of sh*t "enterprise class"..

		Linus

  parent reply	other threads:[~2007-07-16 19:58 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-16 17:12 [PATCH] Do _not_ call unlink on a directory Thomas Glanzmann
2007-07-16 17:18 ` Matthieu Moy
2007-07-16 19:05   ` Scott Lamb
2007-07-16 19:56     ` Thomas Glanzmann
2007-07-16 20:00     ` Thomas Glanzmann
2007-07-16 20:21       ` Linus Torvalds
2007-07-16 20:25         ` Thomas Glanzmann
2007-07-16 20:34           ` Linus Torvalds
2007-07-16 20:39             ` Thomas Glanzmann
2007-07-16 21:23             ` Scott Lamb
2007-07-16 21:44               ` Linus Torvalds
2007-07-16 21:58                 ` Scott Lamb
2007-07-16 22:03                   ` Linus Torvalds
2007-07-16 20:29         ` Linus Torvalds
2007-07-16 17:38 ` Thomas Glanzmann
2007-07-16 17:41   ` Jan-Benedict Glaw
2007-07-16 17:42   ` Brian Downing
2007-07-16 17:55     ` Thomas Glanzmann
2007-07-16 19:58 ` Linus Torvalds [this message]
2007-07-16 21:06   ` Brian Downing
2007-07-16 21:19     ` Linus Torvalds
2007-07-17  8:58   ` David Kastrup
2007-07-17  7:30 ` Junio C Hamano
2007-07-17  8:28 ` Junio C Hamano
2007-07-17 10:15   ` Thomas Glanzmann
2007-07-17 18:34     ` Junio C Hamano
2007-07-17 20:27       ` Thomas Glanzmann
2007-07-18  7:24         ` Johannes Sixt
2007-07-18  8:50           ` Thomas Glanzmann
2007-07-17 19:07   ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.0.999.0707161252330.20061@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sithglan@stud.uni-erlangen.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).