aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-12-30 01:40:39 -0500
committerFrederic Weisbecker <fweisbec@gmail.com>2010-01-01 19:59:48 -0500
commit835d5247d98f46e35d007dcfa6215e526ca33360 (patch)
tree83caead46ca375781c93648e54adb6873204f569 /fs/reiserfs
parent8b513f56d4e117f11cf0760abcc030eedefc45c3 (diff)
reiserfs: Safely acquire i_mutex from xattr_rmdir
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>
Diffstat (limited to 'fs/reiserfs')
-rw-r--r--fs/reiserfs/xattr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
index bfdac66fd8e2..9623cfe2371c 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -98,7 +98,8 @@ static int xattr_rmdir(struct inode *dir, struct dentry *dentry)
98 BUG_ON(!mutex_is_locked(&dir->i_mutex)); 98 BUG_ON(!mutex_is_locked(&dir->i_mutex));
99 vfs_dq_init(dir); 99 vfs_dq_init(dir);
100 100
101 mutex_lock_nested(&dentry->d_inode->i_mutex, I_MUTEX_CHILD); 101 reiserfs_mutex_lock_nested_safe(&dentry->d_inode->i_mutex,
102 I_MUTEX_CHILD, dir->i_sb);
102 dentry_unhash(dentry); 103 dentry_unhash(dentry);
103 error = dir->i_op->rmdir(dir, dentry); 104 error = dir->i_op->rmdir(dir, dentry);
104 if (!error) 105 if (!error)