Re: [BUG] Inconsistent behaviour of rmdir

From: Guest section DW (dwguest@win.tue.nl)
Date: Fri Nov 17 2000 - 12:56:38 EST


On Thu, Nov 16, 2000 at 02:47:35PM +0100, Jean-Marc Saffroy wrote:

> As you see, it looks like the rmdir fails simply because the dir name ends
> with a dot !! This is confirmed by sys_rmdir in fs/namei.c, around line
> 1384 :
>
> switch(nd.last_type) {
> case LAST_DOTDOT:
> error = -ENOTEMPTY;
> goto exit1;
> case LAST_ROOT: case LAST_DOT:
> error = -EBUSY;
> goto exit1;
> }

I see that an entire discussion has taken place. Let me just remark this,
quoting the Austin draft:

If the path argument refers to a path whose final component is either
dot or dot-dot, rmdir( ) shall fail.

EINVAL The path argument contains a last component that is dot.
EEXIST or ENOTEMPTY The path argument names a directory that is not an empty directory,
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.

So, it seems that -EINVAL would be a better return value in case LAST_DOT.

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/



This archive was generated by hypermail 2b29 : Thu Nov 23 2000 - 21:00:13 EST