]> www.infradead.org Git - users/hch/misc.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)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 25 Sep 2025 18:17:16 +0000 (14:17 -0400)
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>
fs/ext4/xattr.c

index 5a6fe1513fd20522b8f310afa2e78de62d053f12..7743d81b2f213220498a76003f20742a7f125e52 100644 (file)
@@ -1530,7 +1530,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;