Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 117480
b: refs/heads/master
c: 0612d9f
h: refs/heads/master
v: v3
  • Loading branch information
OGAWA Hirofumi authored and Al Viro committed Oct 23, 2008
1 parent ce6f6ff commit 78cf7f0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8f3dfaa5bab767a043c5af5b879fb86c03329f8a
refs/heads/master: 0612d9fb270a474fe6a46cc5b8d3f5b71cf5f580
27 changes: 18 additions & 9 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -2170,16 +2170,19 @@ static long do_rmdir(int dfd, const char __user *pathname)
return error;

switch(nd.last_type) {
case LAST_DOTDOT:
error = -ENOTEMPTY;
goto exit1;
case LAST_DOT:
error = -EINVAL;
goto exit1;
case LAST_ROOT:
error = -EBUSY;
goto exit1;
case LAST_DOTDOT:
error = -ENOTEMPTY;
goto exit1;
case LAST_DOT:
error = -EINVAL;
goto exit1;
case LAST_ROOT:
error = -EBUSY;
goto exit1;
}

nd.flags &= ~LOOKUP_PARENT;

mutex_lock_nested(&nd.path.dentry->d_inode->i_mutex, I_MUTEX_PARENT);
dentry = lookup_hash(&nd);
error = PTR_ERR(dentry);
Expand Down Expand Up @@ -2257,6 +2260,9 @@ static long do_unlinkat(int dfd, const char __user *pathname)
error = -EISDIR;
if (nd.last_type != LAST_NORM)
goto exit1;

nd.flags &= ~LOOKUP_PARENT;

mutex_lock_nested(&nd.path.dentry->d_inode->i_mutex, I_MUTEX_PARENT);
dentry = lookup_hash(&nd);
error = PTR_ERR(dentry);
Expand Down Expand Up @@ -2646,6 +2652,9 @@ asmlinkage long sys_renameat(int olddfd, const char __user *oldname,
if (newnd.last_type != LAST_NORM)
goto exit2;

oldnd.flags &= ~LOOKUP_PARENT;
newnd.flags &= ~LOOKUP_PARENT;

trap = lock_rename(new_dir, old_dir);

old_dentry = lookup_hash(&oldnd);
Expand Down

0 comments on commit 78cf7f0

Please sign in to comment.