Skip to contentSkip to conversation

reiserfs: Relax reiserfs_xattr_set_handle() while acquiring xattr locks

PATCH New Frederic Weisbecker 1 participant 1 message Jan 7, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 reiserfs: Relax reiserfs_xattr_set_handle() while acquiring xattr locks

Fix remaining xattr locks acquired in reiserfs_xattr_set_handle() while we are holding the reiserfs lock to avoid lock inversions.

Cc Christian Kujau <[email protected]>
Cc Alexander Beregalov <[email protected]>
Cc Chris Mason <[email protected]>
Cc Ingo Molnar <[email protected]>
---
 fs/reiserfs/xattr.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
fs/reiserfs/xattr.c +4 -0
index 35826d2..b91428e 100644
@@ -560,8 +560,12 @@ reiserfs_xattr_set_handle(struct reiserfs_transaction_handle *th,
 			.ia_size = buffer_size,
 			.ia_valid = ATTR_SIZE | ATTR_CTIME,
 		};
+
+		reiserfs_write_unlock(inode->i_sb);
 		mutex_lock_nested(&dentry->d_inode->i_mutex, I_MUTEX_XATTR);
 		down_write(&dentry->d_inode->i_alloc_sem);
+		reiserfs_write_lock(inode->i_sb);
+
 		err = reiserfs_setattr(dentry, &newattrs);
 		up_write(&dentry->d_inode->i_alloc_sem);
 		mutex_unlock(&dentry->d_inode->i_mutex);
Signature · 1 line
1.6.2.3