]> 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:34:30 +0000 (15:34 -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 5ddfa4801bb30029074a5b34a9b47be4544c4257..ce986312bf685646859f9d89e72afee207f822df 100644 (file)
@@ -1552,7 +1552,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;