Re: [BUG] Inconsistent behaviour of rmdir

From: Alexander Viro (viro@math.psu.edu)
Date: Fri Nov 17 2000 - 15:27:31 EST


On Fri, 17 Nov 2000, Guest section DW wrote:

> 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.
[snip]

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

No problems with that... Linus, could you apply the following (cut-and-paste
alert)?
--- fs/namei.c Fri Nov 17 18:43:20 2000
+++ fs/namei.c.new Fri Nov 17 18:48:00 2000
@@ -1381,8 +1381,11 @@
                case LAST_DOTDOT:
                        error = -ENOTEMPTY;
                        goto exit1;
- case LAST_ROOT: case LAST_DOT:
+ case LAST_ROOT:
                        error = -EBUSY;
+ goto exit1;
+ case LAST_DOT:
+ error = -EINVAL;
                        goto exit1;
        }
        down(&nd.dentry->d_inode->i_sem);

-
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:14 EST