Commit 3643f1c8 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] IS_DEADDIR checks (2.5)

	2.4 variant will go to Marcelo in a couple of minutes.

Patch moves IS_DEADDIR() checks into may_delete().
parent e913fd70
...@@ -881,6 +881,8 @@ static inline int may_delete(struct inode *dir,struct dentry *victim, int isdir) ...@@ -881,6 +881,8 @@ static inline int may_delete(struct inode *dir,struct dentry *victim, int isdir)
return -EBUSY; return -EBUSY;
} else if (S_ISDIR(victim->d_inode->i_mode)) } else if (S_ISDIR(victim->d_inode->i_mode))
return -EISDIR; return -EISDIR;
if (IS_DEADDIR(dir))
return -ENOENT;
return 0; return 0;
} }
...@@ -1390,9 +1392,7 @@ int vfs_rmdir(struct inode *dir, struct dentry *dentry) ...@@ -1390,9 +1392,7 @@ int vfs_rmdir(struct inode *dir, struct dentry *dentry)
down(&dentry->d_inode->i_sem); down(&dentry->d_inode->i_sem);
d_unhash(dentry); d_unhash(dentry);
if (IS_DEADDIR(dir)) if (d_mountpoint(dentry))
error = -ENOENT;
else if (d_mountpoint(dentry))
error = -EBUSY; error = -EBUSY;
else { else {
error = dir->i_op->rmdir(dir, dentry); error = dir->i_op->rmdir(dir, dentry);
...@@ -1776,8 +1776,6 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_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) if (!old_dir->i_op || !old_dir->i_op->rename)
return -EPERM; return -EPERM;
if (IS_DEADDIR(old_dir)||IS_DEADDIR(new_dir))
return -ENOENT;
DQUOT_INIT(old_dir); DQUOT_INIT(old_dir);
DQUOT_INIT(new_dir); DQUOT_INIT(new_dir);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment