summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-02-09 15:13:05 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2026-02-09 15:13:05 -0800
commit9e355113f02be17db573d579515dee63621b7c8b (patch)
tree9d6d6dea7ccae97b5439a91d30eed16b5821cfb9 /init
parent3304b3fedddfb1357c7f9e25526b5a7899ee1f13 (diff)
parent6cbfdf89470ef3c2110f376a507d135e7a7a7378 (diff)
Merge tag 'vfs-7.0-rc1.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
Pull misc vfs updates from Christian Brauner: "This contains a mix of VFS cleanups, performance improvements, API fixes, documentation, and a deprecation notice. Scalability and performance: - Rework pid allocation to only take pidmap_lock once instead of twice during alloc_pid(), improving thread creation/teardown throughput by 10-16% depending on false-sharing luck. Pad the namespace refcount to reduce false-sharing - Track file lock presence via a flag in ->i_opflags instead of reading ->i_flctx, avoiding false-sharing with ->i_readcount on open/close hot paths. Measured 4-16% improvement on 24-core open-in-a-loop benchmarks - Use a consume fence in locks_inode_context() to match the store-release/load-consume idiom, eliminating a hardware fence on some architectures - Annotate cdev_lock with __cacheline_aligned_in_smp to prevent false-sharing - Remove a redundant DCACHE_MANAGED_DENTRY check in __follow_mount_rcu() that never fires since the caller already verifies it, eliminating a 100% mispredicted branch - Fix a 100% mispredicted likely() in devcgroup_inode_permission() that became wrong after a prior code reorder Bug fixes and correctness: - Make insert_inode_locked() wait for inode destruction instead of skipping, fixing a corner case where two matching inodes could exist in the hash - Move f_mode initialization before file_ref_init() in alloc_file() to respect the SLAB_TYPESAFE_BY_RCU ordering contract - Add a WARN_ON_ONCE guard in try_to_free_buffers() for folios with no buffers attached, preventing a null pointer dereference when AS_RELEASE_ALWAYS is set but no release_folio op exists - Fix select restart_block to store end_time as timespec64, avoiding truncation of tv_sec on 32-bit architectures - Make dump_inode() use get_kernel_nofault() to safely access inode and superblock fields, matching the dump_mapping() pattern API modernization: - Make posix_acl_to_xattr() allocate the buffer internally since every single caller was doing it anyway. Reduces boilerplate and unnecessary error checking across ~15 filesystems - Replace deprecated simple_strtoul() with kstrtoul() for the ihash_entries, dhash_entries, mhash_entries, and mphash_entries boot parameters, adding proper error handling - Convert chardev code to use guard(mutex) and __free(kfree) cleanup patterns - Replace min_t() with min() or umin() in VFS code to avoid silently truncating unsigned long to unsigned int - Gate LOOKUP_RCU assertions behind CONFIG_DEBUG_VFS since callers already check the flag Deprecation: - Begin deprecating legacy BSD process accounting (acct(2)). The interface has numerous footguns and better alternatives exist (eBPF) Documentation: - Fix and complete kernel-doc for struct export_operations, removing duplicated documentation between ReST and source - Fix kernel-doc warnings for __start_dirop() and ilookup5_nowait() Testing: - Add a kunit test for initramfs cpio handling of entries with filesize > PATH_MAX Misc: - Add missing <linux/init_task.h> include in fs_struct.c" * tag 'vfs-7.0-rc1.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: (28 commits) posix_acl: make posix_acl_to_xattr() alloc the buffer fs: make insert_inode_locked() wait for inode destruction initramfs_test: kunit test for cpio.filesize > PATH_MAX fs: improve dump_inode() to safely access inode fields fs: add <linux/init_task.h> for 'init_fs' docs: exportfs: Use source code struct documentation fs: move initializing f_mode before file_ref_init() exportfs: Complete kernel-doc for struct export_operations exportfs: Mark struct export_operations functions at kernel-doc exportfs: Fix kernel-doc output for get_name() acct(2): begin the deprecation of legacy BSD process accounting device_cgroup: remove branch hint after code refactor VFS: fix __start_dirop() kernel-doc warnings fs: Describe @isnew parameter in ilookup5_nowait() fs/namei: Remove redundant DCACHE_MANAGED_DENTRY check in __follow_mount_rcu fs: only assert on LOOKUP_RCU when built with CONFIG_DEBUG_VFS select: store end_time as timespec64 in restart block chardev: Switch to guard(mutex) and __free(kfree) namespace: Replace simple_strtoul with kstrtoul to parse boot params dcache: Replace simple_strtoul with kstrtoul in set_dhash_entries ...
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig7
-rw-r--r--init/initramfs_test.c48
2 files changed, 53 insertions, 2 deletions
diff --git a/init/Kconfig b/init/Kconfig
index fa79feb8fe57..160c1c4ef253 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -624,8 +624,9 @@ config SCHED_HW_PRESSURE
arch_update_hw_pressure() and arch_scale_thermal_pressure().
config BSD_PROCESS_ACCT
- bool "BSD Process Accounting"
+ bool "BSD Process Accounting (DEPRECATED)"
depends on MULTIUSER
+ default n
help
If you say Y here, a user level program will be able to instruct the
kernel (via a special system call) to write process accounting
@@ -635,7 +636,9 @@ config BSD_PROCESS_ACCT
command name, memory usage, controlling terminal etc. (the complete
list is in the struct acct in <file:include/linux/acct.h>). It is
up to the user level program to do useful things with this
- information. This is generally a good idea, so say Y.
+ information. This mechanism is antiquated and has significant
+ scalability issues. You probably want to use eBPF instead. Say
+ N unless you really need this.
config BSD_PROCESS_ACCT_V3
bool "BSD Process Accounting version 3 file format"
diff --git a/init/initramfs_test.c b/init/initramfs_test.c
index 5d2db455e60c..beb6e3cf7808 100644
--- a/init/initramfs_test.c
+++ b/init/initramfs_test.c
@@ -447,6 +447,53 @@ out:
kfree(tbufs);
}
+static void __init initramfs_test_fname_path_max(struct kunit *test)
+{
+ char *err;
+ size_t len;
+ struct kstat st0, st1;
+ char fdata[] = "this file data will not be unpacked";
+ struct test_fname_path_max {
+ char fname_oversize[PATH_MAX + 1];
+ char fname_ok[PATH_MAX];
+ char cpio_src[(CPIO_HDRLEN + PATH_MAX + 3 + sizeof(fdata)) * 2];
+ } *tbufs = kzalloc(sizeof(struct test_fname_path_max), GFP_KERNEL);
+ struct initramfs_test_cpio c[] = { {
+ .magic = "070701",
+ .ino = 1,
+ .mode = S_IFDIR | 0777,
+ .nlink = 1,
+ .namesize = sizeof(tbufs->fname_oversize),
+ .fname = tbufs->fname_oversize,
+ .filesize = sizeof(fdata),
+ .data = fdata,
+ }, {
+ .magic = "070701",
+ .ino = 2,
+ .mode = S_IFDIR | 0777,
+ .nlink = 1,
+ .namesize = sizeof(tbufs->fname_ok),
+ .fname = tbufs->fname_ok,
+ } };
+
+ memset(tbufs->fname_oversize, '/', sizeof(tbufs->fname_oversize) - 1);
+ memset(tbufs->fname_ok, '/', sizeof(tbufs->fname_ok) - 1);
+ memcpy(tbufs->fname_oversize, "fname_oversize",
+ sizeof("fname_oversize") - 1);
+ memcpy(tbufs->fname_ok, "fname_ok", sizeof("fname_ok") - 1);
+ len = fill_cpio(c, ARRAY_SIZE(c), tbufs->cpio_src);
+
+ /* unpack skips over fname_oversize instead of returning an error */
+ err = unpack_to_rootfs(tbufs->cpio_src, len);
+ KUNIT_EXPECT_NULL(test, err);
+
+ KUNIT_EXPECT_EQ(test, init_stat("fname_oversize", &st0, 0), -ENOENT);
+ KUNIT_EXPECT_EQ(test, init_stat("fname_ok", &st1, 0), 0);
+ KUNIT_EXPECT_EQ(test, init_rmdir("fname_ok"), 0);
+
+ kfree(tbufs);
+}
+
/*
* The kunit_case/_suite struct cannot be marked as __initdata as this will be
* used in debugfs to retrieve results after test has run.
@@ -459,6 +506,7 @@ static struct kunit_case __refdata initramfs_test_cases[] = {
KUNIT_CASE(initramfs_test_hardlink),
KUNIT_CASE(initramfs_test_many),
KUNIT_CASE(initramfs_test_fname_pad),
+ KUNIT_CASE(initramfs_test_fname_path_max),
{},
};