linux/fs/ext4
Kees Cook 189f164e57 Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses
Conversion performed via this Coccinelle script:

  // SPDX-License-Identifier: GPL-2.0-only
  // Options: --include-headers-for-types --all-includes --include-headers --keep-comments
  virtual patch

  @gfp depends on patch && !(file in "tools") && !(file in "samples")@
  identifier ALLOC = {kmalloc_obj,kmalloc_objs,kmalloc_flex,
 		    kzalloc_obj,kzalloc_objs,kzalloc_flex,
		    kvmalloc_obj,kvmalloc_objs,kvmalloc_flex,
		    kvzalloc_obj,kvzalloc_objs,kvzalloc_flex};
  @@

  	ALLOC(...
  -		, GFP_KERNEL
  	)

  $ make coccicheck MODE=patch COCCI=gfp.cocci

Build and boot tested x86_64 with Fedora 42's GCC and Clang:

Linux version 6.19.0+ (user@host) (gcc (GCC) 15.2.1 20260123 (Red Hat 15.2.1-7), GNU ld version 2.44-12.fc42) #1 SMP PREEMPT_DYNAMIC 1970-01-01
Linux version 6.19.0+ (user@host) (clang version 20.1.8 (Fedora 20.1.8-4.fc42), LLD 20.1.8) #1 SMP PREEMPT_DYNAMIC 1970-01-01

Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-02-22 08:26:33 -08:00
..
.kunitconfig ext4: add .kunitconfig fragment to enable ext4-specific tests 2021-02-11 23:16:30 -05:00
acl.c ext4: convert to ctime accessor functions 2023-07-24 10:29:54 +02:00
acl.h Revert "ext4: apply umask if ACL support is disabled" 2024-05-02 18:25:39 -04:00
balloc.c fs/ext4: fix typo in comment 2025-11-26 17:13:34 -05:00
bitmap.c ext4: remove sbi argument from ext4_chksum() 2025-05-20 10:31:12 -04:00
block_validity.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
crypto.c ext4: move crypt info pointer to fs-specific part of inode 2025-08-21 13:58:07 +02:00
dir.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ext4.h fsverity updates for 7.0 2026-02-12 10:41:34 -08:00
ext4_extents.h ext4: remove unused EXT_STATS macro from ext4_extents.h 2025-07-12 19:01:38 -04:00
ext4_jbd2.c ext4: make data=journal support large block size 2025-11-28 22:35:28 -05:00
ext4_jbd2.h ext4/jbd2: convert jbd2_journal_blocks_per_page() to support large folio 2025-05-20 10:31:12 -04:00
extents-test.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
extents.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
extents_status.c ext4: add extent status cache support to kunit tests 2026-01-23 16:49:43 -05:00
extents_status.h ext4: make ext4_es_lookup_extent() pass out the extent seq counter 2025-11-06 10:44:39 -05:00
fast_commit.c ext4: fast commit: make s_fc_lock reclaim-safe 2026-01-19 22:46:05 -05:00
fast_commit.h ext4: mark move extents fast-commit ineligible 2026-01-19 19:26:35 -05:00
file.c mm.git review status for linus..mm-stable 2026-02-18 20:50:32 -08:00
fsmap.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
fsmap.h ext4: fsmap: fix the block/inode bitmap comment 2021-06-24 09:48:29 -04:00
fsync.c ext4: add ext4_emergency_state() helper function 2025-03-13 10:16:34 -04:00
hash.c ext4: make error code in __ext4fs_dirhash() consistent. 2025-11-06 10:32:33 -05:00
ialloc.c ext4: clear i_state_flags when alloc inode 2025-11-26 17:06:09 -05:00
indirect.c ext4: add ext4_sb_bread_nofail() helper function for ext4_free_branches() 2025-09-25 14:36:54 -04:00
inline.c ext4: add i_data_sem protection in ext4_destroy_inline_data_nolock() 2025-11-26 17:06:24 -05:00
inode-test.c ext4: add missing MODULE_DESCRIPTION() 2024-07-05 16:07:24 -04:00
inode.c mm.git review status for linus..mm-stable 2026-02-12 11:32:37 -08:00
ioctl.c New features and improvements for the ext4 file system 2026-02-12 10:19:58 -08:00
Kconfig ext4: remove obsolete EXT3 config options 2025-09-25 14:47:05 -04:00
Makefile ext4: move ext4 crypto code to its own file crypto.c 2022-05-21 22:24:24 -04:00
mballoc-test.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mballoc.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
mballoc.h ext4: refactor choose group to scan group 2025-07-25 09:14:17 -04:00
migrate.c ext4: mark inode format migration fast-commit ineligible 2026-01-19 19:26:35 -05:00
mmp.c ext4: use super write guard in write_mmp_block() 2025-11-05 22:52:15 +01:00
move_extent.c ext4: mark move extents fast-commit ineligible 2026-01-19 19:26:35 -05:00
namei.c ext4: add EXT4_LBLK_TO_B macro for logical block to bytes conversion 2025-11-28 22:35:27 -05:00
orphan.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
page-io.c blk-crypto: handle the fallback above the block layer 2026-01-11 12:55:41 -07:00
readpage.c fsverity updates for 7.0 2026-02-12 10:41:34 -08:00
resize.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
super.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
symlink.c ext4_get_link(): fix breakage in RCU mode 2024-02-25 02:10:32 -05:00
sysfs.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
truncate.h ext4: Convert to use mapping->invalidate_lock 2021-07-13 14:29:00 +02:00
verity.c fsverity updates for 7.0 2026-02-12 10:41:34 -08:00
xattr.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
xattr.h ext4: fix out-of-bound read in ext4_xattr_inode_dec_ref_all() 2025-03-18 00:15:19 -04:00
xattr_hurd.c fs: port xattr to mnt_idmap 2023-01-19 09:24:28 +01:00
xattr_security.c fs: port xattr to mnt_idmap 2023-01-19 09:24:28 +01:00
xattr_trusted.c fs: port xattr to mnt_idmap 2023-01-19 09:24:28 +01:00
xattr_user.c fs: port xattr to mnt_idmap 2023-01-19 09:24:28 +01:00