linux/fs/nfs
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
..
blocklayout treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
filelayout treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
flexfilelayout treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
cache_lib.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cache_lib.h
callback.c NFS Client Updates for Linux 7.0 2026-02-12 17:49:33 -08:00
callback.h NFS: Merge CONFIG_NFS_V4_1 with CONFIG_NFS_V4 2026-01-30 11:42:21 -05:00
callback_proc.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
callback_xdr.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
client.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
delegation.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
delegation.h NFS: fix delayed delegation return handling 2026-01-30 16:49:15 -05:00
dir.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
direct.c nfs: direct: drop useless initializer in nfs_direct_write_completion() 2025-04-27 23:25:44 -04:00
dns_resolve.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dns_resolve.h NFS: Avoid memcpy() run-time warning for struct sockaddr overflows 2022-10-27 15:52:10 -04:00
export.c NFS: Fix filehandle bounds checking in nfs_fh_to_dentry() 2025-07-22 09:50:56 -04:00
file.c vfs-7.0-rc1.leases 2026-02-09 11:59:07 -08:00
fs_context.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
fscache.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
fscache.h netfs: Drop the was_async arg from netfs_read_subreq_terminated() 2024-12-20 22:34:03 +01:00
getroot.c nfs: fix the comment of nfs_get_root 2024-09-23 15:03:13 -04:00
inode.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
internal.h NFS: Merge CONFIG_NFS_V4_1 with CONFIG_NFS_V4 2026-01-30 11:42:21 -05:00
io.c NFS: Fix size read races in truncate, fallocate and copy offload 2026-01-15 14:38:25 -05:00
iostat.h mm: add comments for allocation helpers explaining why they are macros 2024-07-12 15:52:20 -07:00
Kconfig NFS: Merge CONFIG_NFS_V4_1 with CONFIG_NFS_V4 2026-01-30 11:42:21 -05:00
localio.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
Makefile NFS: Merge CONFIG_NFS_V4_1 with CONFIG_NFS_V4 2026-01-30 11:42:21 -05:00
mount_clnt.c NFS: Remove unused function nfs_umount 2025-07-14 15:20:28 -07:00
namespace.c NFS: Fix up the automount fs_context to use the correct cred 2025-11-29 17:23:03 -05:00
netns.h NFS: Merge CONFIG_NFS_V4_1 with CONFIG_NFS_V4 2026-01-30 11:42:21 -05:00
nfs.h NFS: Implement get_nfs_version() 2024-11-08 14:17:37 -05:00
nfs2super.c fs: nfs: add missing MODULE_DESCRIPTION() macros 2024-07-08 13:47:24 -04:00
nfs2xdr.c nfs/localio: add tracepoints for misaligned DIO READ and WRITE support 2025-09-30 16:10:30 -04:00
nfs3_fs.h fs: drop unused posix acl handlers 2023-03-06 09:57:12 +01:00
nfs3acl.c nfs: nfs3acl: drop useless assignment in nfs3_get_acl() 2025-04-27 23:25:44 -04:00
nfs3client.c pnfs: Set transport security policy to RPC_XPRTSEC_NONE unless using TLS 2025-11-10 10:32:28 -05:00
nfs3proc.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
nfs3super.c fs: nfs: add missing MODULE_DESCRIPTION() macros 2024-07-08 13:47:24 -04:00
nfs3xdr.c nfs/localio: add tracepoints for misaligned DIO READ and WRITE support 2025-09-30 16:10:30 -04:00
nfs4_fs.h NFSv4: pass lease period in seconds to nfs4_set_lease_period() 2026-02-09 13:39:39 -05:00
nfs4client.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
nfs4file.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
nfs4getroot.c NFSv4: Remove duplicate lookups, capability probes and fsinfo calls 2025-08-04 09:48:16 -07:00
nfs4idmap.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
nfs4idmap.h
nfs4namespace.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
nfs4proc.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
nfs4renewd.c NFSv4: limit lease period in nfs4_set_lease_period() 2026-02-09 13:39:39 -05:00
nfs4session.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
nfs4session.h NFS: Merge CONFIG_NFS_V4_1 with CONFIG_NFS_V4 2026-01-30 11:42:21 -05:00
nfs4state.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
nfs4super.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
nfs4sysctl.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
nfs4trace.c NFS: Merge CONFIG_NFS_V4_1 with CONFIG_NFS_V4 2026-01-30 11:42:21 -05:00
nfs4trace.h NFS: fix delayed delegation return handling 2026-01-30 16:49:15 -05:00
nfs4xdr.c NFS: Merge CONFIG_NFS_V4_1 with CONFIG_NFS_V4 2026-01-30 11:42:21 -05:00
nfs40.h NFS: Move NFS v4.0 pathdown recovery into nfs40client.c 2026-01-30 11:42:20 -05:00
nfs40client.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
nfs40proc.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
nfs42.h NFS: Add support for fallocate(FALLOC_FL_ZERO_RANGE) 2025-05-28 17:17:13 -04:00
nfs42proc.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
nfs42xattr.c mm/list_lru: simplify the list_lru walk callback function 2024-11-11 17:22:26 -08:00
nfs42xdr.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
nfsroot.c NFS: Fix an off by one in root_nfs_cat() 2024-03-09 09:14:51 -05:00
nfstrace.c
nfstrace.h NFS: Fix a deadlock involving nfs_release_folio() 2026-01-04 23:03:24 -05:00
pagelist.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
pnfs.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
pnfs.h NFS: Merge CONFIG_NFS_V4_1 with CONFIG_NFS_V4 2026-01-30 11:42:21 -05:00
pnfs_dev.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
pnfs_nfs.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
proc.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
read.c NFS: Merge CONFIG_NFS_V4_1 with CONFIG_NFS_V4 2026-01-30 11:42:21 -05:00
super.c NFS: Merge CONFIG_NFS_V4_1 with CONFIG_NFS_V4 2026-01-30 11:42:21 -05:00
symlink.c fs: Pass a folio to page_put_link() 2025-05-15 12:14:29 +02:00
sysctl.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
sysfs.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
sysfs.h NFS: Add sysfs links to sunrpc clients for nfs_clients 2023-06-19 15:04:13 -04:00
unlink.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
write.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00