[GIT PULL 17/18 for v7.3] vfs super
Christian Brauner <[email protected]>
| Newsgroups | org.kernel.vger.linux-kernel,org.kernel.vger.linux-fsdevel |
|---|---|
| Message-ID | <20260814-vfs-7.3-rc1.super-03a7095ebb84@brauner> |
Hey Linus, /* Summary */ - Make it possible to share a block device between multiple filesystems. erofs can mount read-only blob devices shared between many superblocks. Because we only tracked a single superblock a freeze, thaw, removal or sync on such a device was never propagated to all the superblocks using it, and there was no way to find them. So add an efficient table to lookup all superblocks using a given block device. - A bunch of pre-existing fixes fell out of this work. A block-device freeze racing a btrfs device change could leave the whole filesystem stuck frozen. A bdev_freeze() issued by "dmsetup suspend" or an LVM snapshot resolves that holder to freeze the filesystem. and bdev_thaw() resolves it again to thaw. A freeze landing while btrfs is adding, removing or replacing a device freezes the filesystem. The membership change then drops that link. So the matching thaw could no longer find the superblock. Forbid freezing a device for the duration of a membership change, modelled on deny_write_access()/allow_write_access(). /* Testing */ No build failures or warnings were observed. /* Conflicts */ Merge conflicts with mainline ============================= [1]: https://lore.kernel.org/linux-next/[email protected] This conflicts with commit d943e68edc5cb ("selftests/filesystems: test O_TMPFILE creation on idmapped mounts") in tools/testing/selftests/filesystems/Makefile and tools/testing/selftests/filesystems/.gitignore. Both that commit and commit a21db4dcaf4ad ("selftests/filesystems: add ustat() coverage") from this tree register a new selftest on the same two lines. The conflict resolves by keeping both. This tag additionally conflicts with two of the earlier tags in this pull request series, so please merge it after them: - with vfs-7.3-rc1.mount - with vfs-7.3-rc1.misc Both resolve by keeping both sides. diff --cc fs/namespace.c index 3c382c2bdeec,7cef6dae0854..1ecd96c918b3 --- a/fs/namespace.c +++ b/fs/namespace.c @@@ -6270,6 -6259,11 +6270,8 @@@ void __init mnt_init(void HASH_ZERO, &mp_hash_shift, &mp_hash_mask, 0, 0); - if (!mount_hashtable || !mountpoint_hashtable) - panic("Failed to allocate mount hash table\n"); - + super_dev_init(); + kernfs_init(); err = sysfs_init(); diff --cc fs/super.c index 2c52c321885f,a62af36f7aaf..05e443173038 --- a/fs/super.c +++ b/fs/super.c @@@ -24,7 -24,7 +24,8 @@@ #include <linux/export.h> #include <linux/slab.h> #include <linux/blkdev.h> +#include <linux/memcontrol.h> + #include <linux/rhashtable.h> #include <linux/mount.h> #include <linux/security.h> #include <linux/writeback.h> /* for the emergency remount stuff */ diff --cc tools/testing/selftests/filesystems/.gitignore index a78f894157de,1bd53d54553c..9eb185fb2f9d --- a/tools/testing/selftests/filesystems/.gitignore +++ b/tools/testing/selftests/filesystems/.gitignore @@@ -5,4 -5,4 +5,5 @@@ fclo file_stressor anon_inode_test kernfs_test +idmapped_tmpfile + ustat_test diff --cc tools/testing/selftests/filesystems/Makefile index a7ec2ba2dd83,bbdd40b167fa..03be337c1f35 --- a/tools/testing/selftests/filesystems/Makefile +++ b/tools/testing/selftests/filesystems/Makefile @@@ -1,8 -1,7 +1,8 @@@ # SPDX-License-Identifier: GPL-2.0 CFLAGS += $(KHDR_INCLUDES) - TEST_GEN_PROGS := devpts_pts file_stressor anon_inode_test kernfs_test fclog + TEST_GEN_PROGS := devpts_pts file_stressor anon_inode_test kernfs_test fclog ustat_test +TEST_GEN_PROGS += idmapped_tmpfile TEST_GEN_PROGS_EXTENDED := dnotify_test include ../lib.mk Merge conflicts with other trees ================================ No known conflicts. The following changes since commit dc59e4fea9d83f03bad6bddf3fa2e52491777482: Linux 7.2-rc1 (2026-06-28 12:01:31 -0700) are available in the Git repository at: [email protected]:pub/scm/linux/kernel/git/vfs/vfs tags/vfs-7.3-rc1.super for you to fetch changes up to 9ac8fd831252e52aa78399eaccc11a72f6c2af1a: super: fix dying superblock warning messages (2026-08-12 09:20:35 +0200) ---------------------------------------------------------------- vfs-7.3-rc1.super Please consider pulling these changes from the signed vfs-7.3-rc1.super tag. Thanks! Christian ---------------------------------------------------------------- Christian Brauner (24): block: allow making a block device unfreezable block: split bdev_yield_claim() out of bdev_fput() btrfs: deny freezing a device while it is being removed btrfs: deny freezing a device while it is being added btrfs: deny freezing devices undergoing a replace Merge patch series "block,btrfs: fix frozen-superblock strand on device add/remove/replace" super: convert s_count to refcount_t s_passive super: take lock after last reference count fs, block: move blk_mode_t and fop_flags_t into <linux/types.h> ext4: use anonymous devices for KUnit test superblocks ocfs2: don't reset s_dev on dismount fs: maintain a global device-to-superblock table fs: add dedicated block device open helpers for filesystems xfs: port to fs_bdev_file_open_by_path() btrfs: open via dedicated fs bdev helpers ext4: open via dedicated fs bdev helpers fs: look up superblocks via the device table in fs_holder_ops fs: tolerate per-superblock freeze errors on shared devices erofs: open via dedicated fs bdev helpers f2fs: open via dedicated fs bdev helpers super: make fs_holder_ops private fs: look up the superblock via the device table in user_get_super() selftests/filesystems: add ustat() coverage Merge patch series "fs: support freeze/thaw/mark_dead/sync with shared devices" Karl Mehltretter (1): super: fix dying superblock warning messages Yun Zhou (1): block: reject block device inodes with i_rdev == 0 in lookup_bdev() block/bdev.c | 125 ++++- fs/btrfs/dev-replace.c | 65 ++- fs/btrfs/ioctl.c | 4 +- fs/btrfs/volumes.c | 105 +++- fs/btrfs/volumes.h | 6 +- fs/cramfs/inode.c | 2 +- fs/erofs/super.c | 35 +- fs/ext4/extents-test.c | 9 +- fs/ext4/mballoc-test.c | 9 +- fs/ext4/super.c | 12 +- fs/f2fs/super.c | 6 +- fs/internal.h | 1 + fs/namespace.c | 2 + fs/ocfs2/super.c | 1 - fs/romfs/super.c | 2 +- fs/super.c | 624 ++++++++++++++++------- fs/xfs/xfs_buf.c | 2 +- fs/xfs/xfs_super.c | 10 +- include/linux/blk_types.h | 2 +- include/linux/blkdev.h | 12 +- include/linux/fs.h | 2 - include/linux/fs/super.h | 8 + include/linux/fs/super_types.h | 4 +- include/linux/types.h | 2 + tools/testing/selftests/filesystems/.gitignore | 1 + tools/testing/selftests/filesystems/Makefile | 2 +- tools/testing/selftests/filesystems/ustat_test.c | 135 +++++ 27 files changed, 882 insertions(+), 306 deletions(-) create mode 100644 tools/testing/selftests/filesystems/ustat_test.c