public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mingming cao <cmm@us.ibm.com>
To: Alexander Viro <viro@math.psu.edu>
Cc: Linus Torvalds <torvalds@transmeta.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH]Fix bug:rmdir could remove current working directory
Date: Wed, 10 Oct 2001 15:03:56 -1000	[thread overview]
Message-ID: <3BC4EFFC.42ACE59E@us.ibm.com> (raw)
In-Reply-To: <Pine.GSO.4.21.0110101743140.21168-100000@weyl.math.psu.edu>

Alexander Viro wrote:
> 
> On Wed, 10 Oct 2001, Mingming cao wrote:
> 
> > Hi Linus, Alan and Al,
> >
> > I found that rmdir(2) could remove current working directory
> > successfully.  This happens when the given pathname points to current
> > working directory, not ".", but something else. For example, the current
> > working directory's absolute pathname.  I read the man page of
> > rmdir(2).  It says in this case EBUSY error should be returned.  I
> > suspected this is a bug and added a check in vfs_rmdir(). The following
> > patch is against 2.4.10 and has been verified.  Please comment and
> > apply.
> 
> It's not a bug.  Moreover, test you add is obviously bogus - what about
> cwd of other processes?
> 
> Actually, rmdir() on a busy directory _is_ OK.  Implementation is allowed
> to refuse doing that, but it's not required to.

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. Should not we keep the rmdir() behavior
consistent: rmdir() on the current working directory of the current
process is not OK?

-- 
Mingming Cao

  reply	other threads:[~2001-10-10 22:05 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 [this message]
2001-10-10 22:09     ` Alexander Viro
2001-10-10 23:17     ` Linus Torvalds
     [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=3BC4EFFC.42ACE59E@us.ibm.com \
    --to=cmm@us.ibm.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    --cc=viro@math.psu.edu \
    /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