From: Theodore Ts'o Date: Wed, 24 May 2023 03:49:49 +0000 (-0400) Subject: ext4: set lockdep subclass for the ea_inode in ext4_xattr_inode_cache_find() X-Git-Tag: Ubuntu-6.2.0-34.34~300 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=e7339db394bb8148995550b52bf3167f1a9b5ddd;p=mirror_ubuntu-kernels.git ext4: set lockdep subclass for the ea_inode in ext4_xattr_inode_cache_find() BugLink: https://bugs.launchpad.net/bugs/2029808 commit b928dfdcb27d8fa59917b794cfba53052a2f050f upstream. 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 Link: https://lore.kernel.org/r/20230524034951.779531-3-tytso@mit.edu Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman Signed-off-by: Kamal Mostafa Signed-off-by: Stefan Bader --- diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index fd73b348b6eb..2a249dd70478 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -1506,6 +1506,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,