Skip to content

Commit

Permalink
reiserfs: Safely acquire i_mutex from xattr_rmdir
Browse files Browse the repository at this point in the history
Relax the reiserfs lock before taking the inode mutex from
xattr_rmdir() to avoid the usual reiserfs lock <-> inode mutex
bad dependency.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Tested-by: Christian Kujau <lists@nerdbynature.de>
Cc: Alexander Beregalov <a.beregalov@gmail.com>
Cc: Chris Mason <chris.mason@oracle.com>
Cc: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Frederic Weisbecker committed Jan 2, 2010
1 parent 8b513f5 commit 835d524
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/reiserfs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ static int xattr_rmdir(struct inode *dir, struct dentry *dentry)
BUG_ON(!mutex_is_locked(&dir->i_mutex));
vfs_dq_init(dir);

mutex_lock_nested(&dentry->d_inode->i_mutex, I_MUTEX_CHILD);
reiserfs_mutex_lock_nested_safe(&dentry->d_inode->i_mutex,
I_MUTEX_CHILD, dir->i_sb);
dentry_unhash(dentry);
error = dir->i_op->rmdir(dir, dentry);
if (!error)
Expand Down

0 comments on commit 835d524

Please sign in to comment.