From: Frederic Weisbecker Date: Thu, 7 Jan 2010 14:55:31 +0000 (+0100) Subject: reiserfs: Relax reiserfs_xattr_set_handle() while acquiring xattr locks X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=31370f62baa1460b785cee9944bdcaf63d19e567;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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. Signed-off-by: Frederic Weisbecker Cc: Christian Kujau Cc: Alexander Beregalov Cc: Chris Mason Cc: Ingo Molnar --- diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c index 4899d789ba67..7fee995c25ab 100644 --- a/fs/reiserfs/xattr.c +++ b/fs/reiserfs/xattr.c @@ -559,8 +559,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);