History log of /linux/tools/testing/selftests/filesystems/anon_inode_test.c (Results 1 – 8 of 8)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: v6.15
# a1b4a25a 21-May-2025 Christian Brauner <brauner@kernel.org>

Merge netfs API documentation updates

Bring in the netfs API documentation updates which had been in the
vfs-6.16.misc branch for most of this cycle. So don't needlessly rewrite
the vfs-6.16.misc by

Merge netfs API documentation updates

Bring in the netfs API documentation updates which had been in the
vfs-6.16.misc branch for most of this cycle. So don't needlessly rewrite
the vfs-6.16.misc by dropping it from that branch and moving it to
vfs-6.16.netfs. Simply merge vfs-6.16.misc into vfs-6.16.netfs.

Signed-off-by: Christian Brauner <brauner@kernel.org>

show more ...


# 4cb6c8af 30-May-2025 Mark Brown <broonie@kernel.org>

selftests/filesystems: Fix build of anon_inode_test

The newly added anon_inode_test test fails to build due to attempting to
include a nonexisting overlayfs/wrapper.h:

anon_inode_test.c:10:10: fa

selftests/filesystems: Fix build of anon_inode_test

The newly added anon_inode_test test fails to build due to attempting to
include a nonexisting overlayfs/wrapper.h:

anon_inode_test.c:10:10: fatal error: overlayfs/wrappers.h: No such file or directory
10 | #include "overlayfs/wrappers.h"
| ^~~~~~~~~~~~~~~~~~~~~~

This is due to 0bd92b9fe538 ("selftests/filesystems: move wrapper.h out
of overlayfs subdir") which was added in the vfs-6.16.selftests branch
which was based on -rc5 and did not contain the newly added test so once
things were merged into mainline the build started failing - both parent
commits are fine.

Fixes: 3e406741b1989 ("Merge tag 'vfs-6.16-rc1.selftests' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs")
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

show more ...


# 181d8e39 26-May-2025 Linus Torvalds <torvalds@linux-foundation.org>

Merge tag 'vfs-6.16-rc1.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs

Pull misc vfs updates from Christian Brauner:
"This contains the usual selections of misc updates for this cyc

Merge tag 'vfs-6.16-rc1.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs

Pull misc vfs updates from Christian Brauner:
"This contains the usual selections of misc updates for this cycle.

Features:

- Use folios for symlinks in the page cache

FUSE already uses folios for its symlinks. Mirror that conversion
in the generic code and the NFS code. That lets us get rid of a few
folio->page->folio conversions in this path, and some of the few
remaining users of read_cache_page() / read_mapping_page()

- Try and make a few filesystem operations killable on the VFS
inode->i_mutex level

- Add sysctl vfs_cache_pressure_denom for bulk file operations

Some workloads need to preserve more dentries than we currently
allow through out sysctl interface

A HDFS servers with 12 HDDs per server, on a HDFS datanode startup
involves scanning all files and caching their metadata (including
dentries and inodes) in memory. Each HDD contains approximately 2
million files, resulting in a total of ~20 million cached dentries
after initialization

To minimize dentry reclamation, they set vfs_cache_pressure to 1.
Despite this configuration, memory pressure conditions can still
trigger reclamation of up to 50% of cached dentries, reducing the
cache from 20 million to approximately 10 million entries. During
the subsequent cache rebuild period, any HDFS datanode restart
operation incurs substantial latency penalties until full cache
recovery completes

To maintain service stability, more dentries need to be preserved
during memory reclamation. The current minimum reclaim ratio (1/100
of total dentries) remains too aggressive for such workload. This
patch introduces vfs_cache_pressure_denom for more granular cache
pressure control

The configuration [vfs_cache_pressure=1,
vfs_cache_pressure_denom=10000] effectively maintains the full 20
million dentry cache under memory pressure, preventing datanode
restart performance degradation

- Avoid some jumps in inode_permission() using likely()/unlikely()

- Avid a memory access which is most likely a cache miss when
descending into devcgroup_inode_permission()

- Add fastpath predicts for stat() and fdput()

- Anonymous inodes currently don't come with a proper mode causing
issues in the kernel when we want to add useful VFS debug assert.
Fix that by giving them a proper mode and masking it off when we
report it to userspace which relies on them not having any mode

- Anonymous inodes currently allow to change inode attributes because
the VFS falls back to simple_setattr() if i_op->setattr isn't
implemented. This means the ownership and mode for every single
user of anon_inode_inode can be changed. Block that as it's either
useless or actively harmful. If specific ownership is needed the
respective subsystem should allocate anonymous inodes from their
own private superblock

- Raise SB_I_NODEV and SB_I_NOEXEC on the anonymous inode superblock

- Add proper tests for anonymous inode behavior

- Make it easy to detect proper anonymous inodes and to ensure that
we can detect them in codepaths such as readahead()

Cleanups:

- Port pidfs to the new anon_inode_{g,s}etattr() helpers

- Try to remove the uselib() system call

- Add unlikely branch hint return path for poll

- Add unlikely branch hint on return path for core_sys_select

- Don't allow signals to interrupt getdents copying for fuse

- Provide a size hint to dir_context for during readdir()

- Use writeback_iter directly in mpage_writepages

- Update compression and mtime descriptions in initramfs
documentation

- Update main netfs API document

- Remove useless plus one in super_cache_scan()

- Remove unnecessary NULL-check guards during setns()

- Add separate separate {get,put}_cgroup_ns no-op cases

Fixes:

- Fix typo in root= kernel parameter description

- Use KERN_INFO for infof()|info_plog()|infofc()

- Correct comments of fs_validate_description()

- Mark an unlikely if condition with unlikely() in
vfs_parse_monolithic_sep()

- Delete macro fsparam_u32hex()

- Remove unused and problematic validate_constant_table()

- Fix potential unsigned integer underflow in fs_name()

- Make file-nr output the total allocated file handles"

* tag 'vfs-6.16-rc1.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: (43 commits)
fs: Pass a folio to page_put_link()
nfs: Use a folio in nfs_get_link()
fs: Convert __page_get_link() to use a folio
fs/read_write: make default_llseek() killable
fs/open: make do_truncate() killable
fs/open: make chmod_common() and chown_common() killable
include/linux/fs.h: add inode_lock_killable()
readdir: supply dir_context.count as readdir buffer size hint
vfs: Add sysctl vfs_cache_pressure_denom for bulk file operations
fuse: don't allow signals to interrupt getdents copying
Documentation: fix typo in root= kernel parameter description
include/cgroup: separate {get,put}_cgroup_ns no-op case
kernel/nsproxy: remove unnecessary guards
fs: use writeback_iter directly in mpage_writepages
fs: remove useless plus one in super_cache_scan()
fs: add S_ANON_INODE
fs: remove uselib() system call
device_cgroup: avoid access to ->i_rdev in the common case in devcgroup_inode_permission()
fs/fs_parse: Remove unused and problematic validate_constant_table()
fs: touch up predicts in inode_permission()
...

show more ...


Revision tags: v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3, v6.15-rc2
# 9d36c514 07-Apr-2025 Christian Brauner <brauner@kernel.org>

Merge patch series "fs: harden anon inodes"

Christian Brauner <brauner@kernel.org> says:

* Anonymous inodes currently don't come with a proper mode causing
issues in the kernel when we want to ad

Merge patch series "fs: harden anon inodes"

Christian Brauner <brauner@kernel.org> says:

* Anonymous inodes currently don't come with a proper mode causing
issues in the kernel when we want to add useful VFS debug assert. Fix
that by giving them a proper mode and masking it off when we report it
to userspace which relies on them not having any mode.

* Anonymous inodes currently allow to change inode attributes because
the VFS falls back to simple_setattr() if i_op->setattr isn't
implemented. This means the ownership and mode for every single user
of anon_inode_inode can be changed. Block that as it's either useless
or actively harmful. If specific ownership is needed the respective
subsystem should allocate anonymous inodes from their own private
superblock.

* Port pidfs to the new anon_inode_{g,s}etattr() helpers.

* Add proper tests for anonymous inode behavior.

The anonymous inode specific fixes should ideally be backported to all
LTS kernels.

* patches from https://lore.kernel.org/20250407-work-anon_inode-v1-0-53a44c20d44e@kernel.org:
selftests/filesystems: add fourth test for anonymous inodes
selftests/filesystems: add third test for anonymous inodes
selftests/filesystems: add second test for anonymous inodes
selftests/filesystems: add first test for anonymous inodes
anon_inode: raise SB_I_NODEV and SB_I_NOEXEC
pidfs: use anon_inode_setattr()
anon_inode: explicitly block ->setattr()
pidfs: use anon_inode_getattr()
anon_inode: use a proper mode internally

Link: https://lore.kernel.org/20250407-work-anon_inode-v1-0-53a44c20d44e@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>

show more ...


# 25a6cc9a 07-Apr-2025 Christian Brauner <brauner@kernel.org>

selftests/filesystems: add open() test for anonymous inodes

Test that anonymous inodes cannot be open()ed.

Link: https://lore.kernel.org/20250407-work-anon_inode-v1-9-53a44c20d44e@kernel.org
Review

selftests/filesystems: add open() test for anonymous inodes

Test that anonymous inodes cannot be open()ed.

Link: https://lore.kernel.org/20250407-work-anon_inode-v1-9-53a44c20d44e@kernel.org
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>

show more ...


# f8ca403a 07-Apr-2025 Christian Brauner <brauner@kernel.org>

selftests/filesystems: add exec() test for anonymous inodes

Test that anonymous inodes cannot be exec()ed.

Link: https://lore.kernel.org/20250407-work-anon_inode-v1-8-53a44c20d44e@kernel.org
Review

selftests/filesystems: add exec() test for anonymous inodes

Test that anonymous inodes cannot be exec()ed.

Link: https://lore.kernel.org/20250407-work-anon_inode-v1-8-53a44c20d44e@kernel.org
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>

show more ...


# fcf31ec7 07-Apr-2025 Christian Brauner <brauner@kernel.org>

selftests/filesystems: add chmod() test for anonymous inodes

Test that anonymous inodes cannot be chmod()ed.

Link: https://lore.kernel.org/20250407-work-anon_inode-v1-7-53a44c20d44e@kernel.org
Revi

selftests/filesystems: add chmod() test for anonymous inodes

Test that anonymous inodes cannot be chmod()ed.

Link: https://lore.kernel.org/20250407-work-anon_inode-v1-7-53a44c20d44e@kernel.org
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>

show more ...


# c7841597 07-Apr-2025 Christian Brauner <brauner@kernel.org>

selftests/filesystems: add chown() test for anonymous inodes

Test that anonymous inodes cannot be chown()ed.

Link: https://lore.kernel.org/20250407-work-anon_inode-v1-6-53a44c20d44e@kernel.org
Revi

selftests/filesystems: add chown() test for anonymous inodes

Test that anonymous inodes cannot be chown()ed.

Link: https://lore.kernel.org/20250407-work-anon_inode-v1-6-53a44c20d44e@kernel.org
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>

show more ...