public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: torvalds@transmeta.com (Linus Torvalds)
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH]Fix bug:rmdir could remove current working directory
Date: Wed, 10 Oct 2001 23:17:45 +0000 (UTC)	[thread overview]
Message-ID: <9q2kup$31b$1@penguin.transmeta.com> (raw)
In-Reply-To: <Pine.GSO.4.21.0110101743140.21168-100000@weyl.math.psu.edu> <3BC4EFFC.42ACE59E@us.ibm.com>

In article <3BC4EFFC.42ACE59E@us.ibm.com>,
Mingming cao  <cmm@us.ibm.com> wrote:
>
>I thought about the case when rmdir() on the cwd of other processes,
>but, as you said, that is implementation dependent. However rmdir() on
>"." does returns EBUSY error.

That's a completely different thing, though - even though the difference
is rather subtle.

You can remove pretty much any empty directory (if the filesystem
permits it - some don't). HOWEVER, you can not use "." as the final
component of your pathname.

It has nothing to do with home directory: you can try just doing

	mkdir /tmp/hello
	rmdir /tmp/hello/.

and you'll get the same error (and it _should_ return EINVAL, not EBUSY.
EBUSY is for the "this filesystem doesn't allow you to remove a
directory that is in use" case).

			Linus

  parent reply	other threads:[~2001-10-10 23:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-11  0:32 [PATCH]Fix bug:rmdir could remove current working directory Mingming cao
2001-10-10 21:45 ` Alexander Viro
2001-10-11  1:03   ` Mingming cao
2001-10-10 22:09     ` Alexander Viro
2001-10-10 23:17     ` Linus Torvalds [this message]
     [not found]     ` <200110102317.f9ANHjN03120@penguin.transmeta.com>
2001-10-11  3:02       ` Mingming cao
2001-10-10 22:21 ` Ricky Beam
2001-10-10 23:36   ` John Levon

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='9q2kup$31b$1@penguin.transmeta.com' \
    --to=torvalds@transmeta.com \
    --cc=linux-kernel@vger.kernel.org \
    /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