]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] IS_DEADDIR checks (2.5)
authorAlexander Viro <viro@math.psu.edu>
Thu, 4 Apr 2002 06:48:10 +0000 (22:48 -0800)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Thu, 4 Apr 2002 06:48:10 +0000 (22:48 -0800)
2.4 variant will go to Marcelo in a couple of minutes.

Patch moves IS_DEADDIR() checks into may_delete().

fs/namei.c

index 40942644371dd1bc1f91b7d724a17f67fb8ed8e8..5813b32b98f7e96b6515f8b341c04a885905a96c 100644 (file)
@@ -881,6 +881,8 @@ static inline int may_delete(struct inode *dir,struct dentry *victim, int isdir)
                        return -EBUSY;
        } else if (S_ISDIR(victim->d_inode->i_mode))
                return -EISDIR;
+       if (IS_DEADDIR(dir))
+               return -ENOENT;
        return 0;
 }
 
@@ -1390,9 +1392,7 @@ int vfs_rmdir(struct inode *dir, struct dentry *dentry)
 
        down(&dentry->d_inode->i_sem);
        d_unhash(dentry);
-       if (IS_DEADDIR(dir))
-               error = -ENOENT;
-       else if (d_mountpoint(dentry))
+       if (d_mountpoint(dentry))
                error = -EBUSY;
        else {
                error = dir->i_op->rmdir(dir, dentry);
@@ -1776,8 +1776,6 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
        if (!old_dir->i_op || !old_dir->i_op->rename)
                return -EPERM;
 
-       if (IS_DEADDIR(old_dir)||IS_DEADDIR(new_dir))
-               return -ENOENT;
        DQUOT_INIT(old_dir);
        DQUOT_INIT(new_dir);