]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fs: ext4: change GFP_KERNEL to GFP_NOFS to avoid deadlock
authorchuguangqing <chuguangqing@inspur.com>
Wed, 6 Aug 2025 02:28:49 +0000 (10:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:37:31 +0000 (15:37 -0500)
[ Upstream commit 1534f72dc2a11ded38b0e0268fbcc0ca24e9fd4a ]

The parent function ext4_xattr_inode_lookup_create already uses GFP_NOFS for memory alloction, so the function ext4_xattr_inode_cache_find should use same gfp_flag.

Signed-off-by: chuguangqing <chuguangqing@inspur.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ext4/xattr.c

index b0e60a44dae9dca72edb94a9c365945328d8073e..ce7253b3f549961fccfa2d73905d6b85bed60e68 100644 (file)
@@ -1535,7 +1535,7 @@ ext4_xattr_inode_cache_find(struct inode *inode, const void *value,
        WARN_ON_ONCE(ext4_handle_valid(journal_current_handle()) &&
                     !(current->flags & PF_MEMALLOC_NOFS));
 
-       ea_data = kvmalloc(value_len, GFP_KERNEL);
+       ea_data = kvmalloc(value_len, GFP_NOFS);
        if (!ea_data) {
                mb_cache_entry_put(ea_inode_cache, ce);
                return NULL;