ext4: add lockdep annotations for i_data_sem for ea_inode's
authorTheodore Ts'o <tytso@mit.edu>
Wed, 24 May 2023 03:49:51 +0000 (23:49 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Jun 2023 08:34:26 +0000 (10:34 +0200)
commitef8aeffb2c5048fb171a7a5059c22bebdbd7e6dc
tree3b7a47c7d63b9dcceaf67086f5e89bec1b050588
parent140aa33f96d6df51e1c8d161fcc603617a1fd0de
ext4: add lockdep annotations for i_data_sem for ea_inode's

commit aff3bea95388299eec63440389b4545c8041b357 upstream.

Treat i_data_sem for ea_inodes as being in their own lockdep class to
avoid lockdep complaints about ext4_setattr's use of inode_lock() on
normal inodes potentially causing lock ordering with i_data_sem on
ea_inodes in ext4_xattr_inode_write().  However, ea_inodes will be
operated on by ext4_setattr(), so this isn't a problem.

Cc: stable@kernel.org
Link: https://syzkaller.appspot.com/bug?extid=298c5d8fb4a128bc27b0
Reported-by: syzbot+298c5d8fb4a128bc27b0@syzkaller.appspotmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Link: https://lore.kernel.org/r/20230524034951.779531-5-tytso@mit.edu
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/ext4.h
fs/ext4/xattr.c