Commit 835d5247d98f46e35d007dcfa6215e526ca33360
1 parent
8b513f56d4
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>
Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff
fs/reiserfs/xattr.c
... | ... | @@ -98,7 +98,8 @@ |
98 | 98 | BUG_ON(!mutex_is_locked(&dir->i_mutex)); |
99 | 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 | 103 | dentry_unhash(dentry); |
103 | 104 | error = dir->i_op->rmdir(dir, dentry); |
104 | 105 | if (!error) |