public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: `rmdir .` doesn't work in 2.4
@ 2001-01-09 13:41 Jesse Pollard
  2001-01-09 14:06 ` Andrea Arcangeli
  2001-01-09 14:23 ` Alexander Viro
  0 siblings, 2 replies; 44+ messages in thread
From: Jesse Pollard @ 2001-01-09 13:41 UTC (permalink / raw)
  To: andrea, linux-kernel; +Cc: Alexander Viro

---------  Received message begins Here  ---------

> 
> Hello Al,
> 
> why `rmdir .` is been deprecated in 2.4.x?  I wrote software that depends on
> `rmdir .` to work (it's local software only for myself so I don't care that it
> may not work on unix) and I'm getting flooded by failing cronjobs since I put
> 2.4.0 on such machine.  `rmdir .` makes perfect sense, the cwd dentry remains
> pinned by me until I `cd ..`, when it gets finally deleted from disk.  I'd like
> if we could resurrect such fine feature (adapting userspace is just a few liner
> but that isn't the point). Comments?

Not exactly valid, since a file could be created in that "pinned" directory
after the rmdir...

-------------------------------------------------------------------------
Jesse I Pollard, II
Email: pollard@navo.hpc.mil

Any opinions expressed are solely my own.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 44+ messages in thread
* Re: `rmdir .` doesn't work in 2.4
@ 2001-01-09 14:38 Jesse Pollard
  0 siblings, 0 replies; 44+ messages in thread
From: Jesse Pollard @ 2001-01-09 14:38 UTC (permalink / raw)
  To: viro, Jesse Pollard; +Cc: andrea, linux-kernel


> On Tue, 9 Jan 2001, Jesse Pollard wrote:
> 
> > Not exactly valid, since a file could be created in that "pinned" directory
> > after the rmdir...
> 
> No, it couldn't (if you can show a testcase when it would - please do, you've
> found a bug). Moreover, busy directories can be removed in 2.4 quite fine -
> it's about pathname, not about the thing being your (or somebody else) pwd.

Apologies to all, foot-in-mouth disease....

-------------------------------------------------------------------------
Jesse I Pollard, II
Email: pollard@navo.hpc.mil

Any opinions expressed are solely my own.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 44+ messages in thread
* Re: `rmdir .` doesn't work in 2.4
@ 2001-01-09 12:18 Andries.Brouwer
  0 siblings, 0 replies; 44+ messages in thread
From: Andries.Brouwer @ 2001-01-09 12:18 UTC (permalink / raw)
  To: Andries.Brouwer, andrea; +Cc: linux-kernel, viro

> I trust your specs said so, however I'm not sure which are the specs
> we should follow for Linux.

> At least for LFS 2.2.x fixage I always followed the SuSv2 specs

We are Linux, and free to do whatever we want.
However, following POSIX makes a large body of software available.
It would be very unwise to deviate from POSIX if it can be avoided.

Now POSIX describes only part of Unix, and for other parts we get
our inspiration from SVID, or X/Open, or SUSv2, or by looking at
what other Unix-like systems do, like *BSD*, Solaris, AIX, etc.
But these sources are often contradictory.

The next version of the POSIX standard (which will simultaneously
be SUSv3) is expected a few months from now. As soon as it exists,
we'll want to follow it, as much as possible. Today it doesnt exist,
but in case of doubt it is reasonable to follow the draft.
(And in case the draft is really ridiculous, there is still time
to file a change request.)

Andries


See http://www.opengroup.org/austin/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 44+ messages in thread
* Re: `rmdir .` doesn't work in 2.4
@ 2001-01-08 22:50 Andries.Brouwer
  2001-01-08 23:22 ` Andrea Arcangeli
  2001-01-09 17:02 ` Kurt Roeckx
  0 siblings, 2 replies; 44+ messages in thread
From: Andries.Brouwer @ 2001-01-08 22:50 UTC (permalink / raw)
  To: Andries.Brouwer, andrea; +Cc: linux-kernel, viro

    From: Andrea Arcangeli <andrea@suse.de>

    > But in fact it fails with EINVAL, and
    > 
    > [EINVAL]: The path argument contains a last component that is dot.

    I can't confirm. The specs I'm checking are here:

        http://www.opengroup.org/onlinepubs/007908799/xsh/rmdir.html

That is the SUSv2 text, one of the ingredients for the new
POSIX standard. I quoted the current Austin draft, the current
draft for the next version of the POSIX standard.

Quoting a text fragment:

        The rmdir( ) function shall remove a directory whose name is given by
        path. The directory is removed only if it is an empty directory.
        If the directory is the root directory or the current working
        directory of any process, it is unspecified whether the function
        succeeds, or whether it shall fail and set errno to [EBUSY].
        If path names a symbolic link, then rmdir( ) shall fail and
        set errno to [ENOTDIR]. If the path argument refers to a path
        whose final component is either dot or dot-dot, rmdir( ) shall
        fail. ...


    > Indeed, rmdir("P/D") does roughly the following:
    > (i) check that P/D is a directory
    > (ii) check that P/D does not have entries other than . and ..
    > (iii) delete the names . and .. from P/D
    > (iv) delete the name D from P

    SUSv2 is straightforward. It doesn't talk about (iv).

I just made explicit what rmdir() actually does, in order to
show that a trailing dot really is a different case where
other rules than the usual ones would have to be applied.
Indeed, rmdir("foo/bar") finishes by removing the name "bar"
from the directory "foo", but rmdir("foo/.") does not finish
by removing the name "." from the directory "foo".

Andries


[Think classical Unix: there are inodes, and there are names.
The rmdir call, just like rm, removes names. Now foo and foo/.
may both be names for the same inode, but they are not the same name.]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 44+ messages in thread
* Re: `rmdir .` doesn't work in 2.4
@ 2001-01-08 20:56 Andries.Brouwer
  2001-01-08 21:34 ` Andrea Arcangeli
  0 siblings, 1 reply; 44+ messages in thread
From: Andries.Brouwer @ 2001-01-08 20:56 UTC (permalink / raw)
  To: andrea, linux-kernel; +Cc: viro

> why `rmdir .` is been deprecated in 2.4.x?

> `rmdir .` makes perfect sense, the cwd dentry remains pinned

You think that it fails with EBUSY. That would be allowed but not required:

[EBUSY]: The directory to be removed is currently in use by
         the system or some process and the implementation
         considers this to be an error.

Here we are free to consider this "in use" an error or not.
But in fact it fails with EINVAL, and

[EINVAL]: The path argument contains a last component that is dot.

(Quoted from the last Austin draft.)
Thus, for POSIX compliance we do need the current behaviour.

Also logically rmdir(".") is a doubtful operation.
Indeed, rmdir("P/D") does roughly the following:
(i) check that P/D is a directory
(ii) check that P/D does not have entries other than . and ..
(iii) delete the names . and .. from P/D
(iv) delete the name D from P

You see that rmdir("P/.") would have to do something other than (iv),
namely deleting something from the parent directory of P.
In cases where hard links to directories are permitted,
it is not even clear we can talk about "the parent directory".
So, I do not think that "rmdir ." makes perfect sense.

Andries

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 44+ messages in thread
* `rmdir .` doesn't work in 2.4
@ 2001-01-08 17:08 Andrea Arcangeli
  2001-01-08 17:31 ` Mohammad A. Haque
  2001-01-08 17:58 ` Alexander Viro
  0 siblings, 2 replies; 44+ messages in thread
From: Andrea Arcangeli @ 2001-01-08 17:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexander Viro

Hello Al,

why `rmdir .` is been deprecated in 2.4.x?  I wrote software that depends on
`rmdir .` to work (it's local software only for myself so I don't care that it
may not work on unix) and I'm getting flooded by failing cronjobs since I put
2.4.0 on such machine.  `rmdir .` makes perfect sense, the cwd dentry remains
pinned by me until I `cd ..`, when it gets finally deleted from disk.  I'd like
if we could resurrect such fine feature (adapting userspace is just a few liner
but that isn't the point). Comments?

Andrea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2001-01-12 21:56 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-09 13:41 `rmdir .` doesn't work in 2.4 Jesse Pollard
2001-01-09 14:06 ` Andrea Arcangeli
2001-01-10 14:47   ` Stephen C. Tweedie
2001-01-10 15:03     ` Andrea Arcangeli
2001-01-10 17:28       ` Alexander Viro
2001-01-10 17:38         ` Andrea Arcangeli
2001-01-09 14:23 ` Alexander Viro
  -- strict thread matches above, loose matches on Subject: below --
2001-01-09 14:38 Jesse Pollard
2001-01-09 12:18 Andries.Brouwer
2001-01-08 22:50 Andries.Brouwer
2001-01-08 23:22 ` Andrea Arcangeli
2001-01-09 17:02 ` Kurt Roeckx
2001-01-08 20:56 Andries.Brouwer
2001-01-08 21:34 ` Andrea Arcangeli
2001-01-10 22:25   ` Matthias Andree
2001-01-08 17:08 Andrea Arcangeli
2001-01-08 17:31 ` Mohammad A. Haque
2001-01-08 17:55   ` Andrea Arcangeli
2001-01-08 18:04     ` Alexander Viro
2001-01-08 20:30       ` Andrea Arcangeli
2001-01-08 21:08         ` Alexander Viro
2001-01-08 21:56           ` Andrea Arcangeli
2001-01-08 23:28             ` Linus Torvalds
2001-01-09  8:09               ` Stefan Traby
2001-01-09 10:48                 ` Eric Lammerts
2001-01-09  9:31           ` Albert D. Cahalan
2001-01-09 15:00             ` Alexander Viro
2001-01-09 20:59               ` Albert D. Cahalan
2001-01-09 21:42                 ` Alexander Viro
2001-01-08 23:27         ` Linus Torvalds
2001-01-09  0:01           ` Andrea Arcangeli
2001-01-09 13:50             ` Stephen C. Tweedie
2001-01-08 17:58 ` Alexander Viro
2001-01-08 20:28   ` Andrea Arcangeli
2001-01-09 13:52     ` Stephen C. Tweedie
2001-01-08 21:54   ` Stefan Traby
2001-01-08 22:11     ` Benson Chow
2001-01-08 22:37       ` Andrea Arcangeli
2001-01-09  1:37       ` Wakko Warner
2001-01-09  1:55         ` Andrea Arcangeli
2001-01-09  4:56           ` Marc Lehmann
2001-01-11 18:57       ` Bernhard Rosenkraenzer
2001-01-09 13:39     ` Alexander Viro
2001-01-12 18:27   ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox