Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312928
b: refs/heads/master
c: ee3efa9
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Jul 14, 2012
1 parent be4daec commit b18c3ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 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: e77fb7cef87856d9d35f2f4d617d0b97148ee7c2
refs/heads/master: ee3efa91e240f513898050ef305a49a653c8ed90
9 changes: 5 additions & 4 deletions trunk/fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -2387,23 +2387,24 @@ static struct dentry *__d_unalias(struct inode *inode,
struct dentry *dentry, struct dentry *alias)
{
struct mutex *m1 = NULL, *m2 = NULL;
struct dentry *ret;
struct dentry *ret = ERR_PTR(-EBUSY);

/* If alias and dentry share a parent, then no extra locks required */
if (alias->d_parent == dentry->d_parent)
goto out_unalias;

/* See lock_rename() */
ret = ERR_PTR(-EBUSY);
if (!mutex_trylock(&dentry->d_sb->s_vfs_rename_mutex))
goto out_err;
m1 = &dentry->d_sb->s_vfs_rename_mutex;
if (!mutex_trylock(&alias->d_parent->d_inode->i_mutex))
goto out_err;
m2 = &alias->d_parent->d_inode->i_mutex;
out_unalias:
__d_move(alias, dentry);
ret = alias;
if (likely(!d_mountpoint(alias))) {
__d_move(alias, dentry);
ret = alias;
}
out_err:
spin_unlock(&inode->i_lock);
if (m2)
Expand Down

0 comments on commit b18c3ac

Please sign in to comment.