From: chuguangqing Date: Wed, 6 Aug 2025 02:28:49 +0000 (+0800) Subject: fs: ext4: change GFP_KERNEL to GFP_NOFS to avoid deadlock X-Git-Tag: v6.17.8~207 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=009127b0fc013aed193961686c28c2b541a5b2f3;p=thirdparty%2Fkernel%2Fstable.git fs: ext4: change GFP_KERNEL to GFP_NOFS to avoid deadlock [ 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 Signed-off-by: Theodore Ts'o Signed-off-by: Sasha Levin --- diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index b0e60a44dae9d..ce7253b3f5499 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -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;