Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263781
b: refs/heads/master
c: 1d2ef59
h: refs/heads/master
i:
  263779: a4d3abb
v: v3
  • Loading branch information
Al Viro authored and Linus Torvalds committed Sep 14, 2011
1 parent d3e49dc commit 8df686c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 003f6c9df54970d8b19578d195b3e2b398cdbde2
refs/heads/master: 1d2ef5901483004d74947bbf78d5146c24038fe7
4 changes: 4 additions & 0 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -2616,6 +2616,7 @@ int vfs_rmdir(struct inode *dir, struct dentry *dentry)
if (!dir->i_op->rmdir)
return -EPERM;

dget(dentry);
mutex_lock(&dentry->d_inode->i_mutex);

error = -EBUSY;
Expand All @@ -2636,6 +2637,7 @@ int vfs_rmdir(struct inode *dir, struct dentry *dentry)

out:
mutex_unlock(&dentry->d_inode->i_mutex);
dput(dentry);
if (!error)
d_delete(dentry);
return error;
Expand Down Expand Up @@ -3025,6 +3027,7 @@ static int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry,
if (error)
return error;

dget(new_dentry);
if (target)
mutex_lock(&target->i_mutex);

Expand All @@ -3045,6 +3048,7 @@ static int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry,
out:
if (target)
mutex_unlock(&target->i_mutex);
dput(new_dentry);
if (!error)
if (!(old_dir->i_sb->s_type->fs_flags & FS_RENAME_DOES_D_MOVE))
d_move(old_dentry,new_dentry);
Expand Down

0 comments on commit 8df686c

Please sign in to comment.