summaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2023-05-24 05:49:49 +0200
committerTheodore Ts'o <tytso@mit.edu>2023-05-30 21:33:50 +0200
commitb928dfdcb27d8fa59917b794cfba53052a2f050f (patch)
tree294ac1565274e7eceeb4647b2def3411f9ed08d4 /fs/ext4
parentext4: add EA_INODE checking to ext4_iget() (diff)
downloadlinux-b928dfdcb27d8fa59917b794cfba53052a2f050f.tar.xz
linux-b928dfdcb27d8fa59917b794cfba53052a2f050f.zip
ext4: set lockdep subclass for the ea_inode in ext4_xattr_inode_cache_find()
If the ea_inode has been pushed out of the inode cache while there is still a reference in the mb_cache, the lockdep subclass will not be set on the inode, which can lead to some lockdep false positives. Fixes: 33d201e0277b ("ext4: fix lockdep warning about recursive inode locking") Cc: stable@kernel.org Reported-by: syzbot+d4b971e744b1f5439336@syzkaller.appspotmail.com Signed-off-by: Theodore Ts'o <tytso@mit.edu> Link: https://lore.kernel.org/r/20230524034951.779531-3-tytso@mit.edu Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/xattr.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index a27208129a80..ff7ab63c5b4f 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -1539,6 +1539,7 @@ ext4_xattr_inode_cache_find(struct inode *inode, const void *value,
EXT4_IGET_EA_INODE);
if (IS_ERR(ea_inode))
goto next_entry;
+ ext4_xattr_inode_set_class(ea_inode);
if (i_size_read(ea_inode) == value_len &&
!ext4_xattr_inode_read(ea_inode, ea_data, value_len) &&
!ext4_xattr_inode_verify_hashes(ea_inode, NULL, ea_data,