mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
ext4: add lockdep annotations for i_data_sem for ea_inode's
commit aff3bea953 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
140aa33f96
commit
ef8aeffb2c
@@ -1007,11 +1007,13 @@ do { \
|
|||||||
* where the second inode has larger inode number
|
* where the second inode has larger inode number
|
||||||
* than the first
|
* than the first
|
||||||
* I_DATA_SEM_QUOTA - Used for quota inodes only
|
* I_DATA_SEM_QUOTA - Used for quota inodes only
|
||||||
|
* I_DATA_SEM_EA - Used for ea_inodes only
|
||||||
*/
|
*/
|
||||||
enum {
|
enum {
|
||||||
I_DATA_SEM_NORMAL = 0,
|
I_DATA_SEM_NORMAL = 0,
|
||||||
I_DATA_SEM_OTHER,
|
I_DATA_SEM_OTHER,
|
||||||
I_DATA_SEM_QUOTA,
|
I_DATA_SEM_QUOTA,
|
||||||
|
I_DATA_SEM_EA
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -123,7 +123,11 @@ ext4_expand_inode_array(struct ext4_xattr_inode_array **ea_inode_array,
|
|||||||
#ifdef CONFIG_LOCKDEP
|
#ifdef CONFIG_LOCKDEP
|
||||||
void ext4_xattr_inode_set_class(struct inode *ea_inode)
|
void ext4_xattr_inode_set_class(struct inode *ea_inode)
|
||||||
{
|
{
|
||||||
|
struct ext4_inode_info *ei = EXT4_I(ea_inode);
|
||||||
|
|
||||||
lockdep_set_subclass(&ea_inode->i_rwsem, 1);
|
lockdep_set_subclass(&ea_inode->i_rwsem, 1);
|
||||||
|
(void) ei; /* shut up clang warning if !CONFIG_LOCKDEP */
|
||||||
|
lockdep_set_subclass(&ei->i_data_sem, I_DATA_SEM_EA);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user