]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Merge tag 'vfs-7.3-rc1.super' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 17 Aug 2026 20:57:04 +0000 (13:57 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 17 Aug 2026 20:57:04 +0000 (13:57 -0700)
Pull vfs superblock updates from Christian Brauner:

 - Make it possible to share a block device between multiple
   filesystems.

   erofs can mount read-only blob devices shared between many
   superblocks, but 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.

   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().

* tag 'vfs-7.3-rc1.super' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: (24 commits)
  super: fix dying superblock warning messages
  block: reject block device inodes with i_rdev == 0 in lookup_bdev()
  selftests/filesystems: add ustat() coverage
  fs: look up the superblock via the device table in user_get_super()
  super: make fs_holder_ops private
  f2fs: open via dedicated fs bdev helpers
  erofs: open via dedicated fs bdev helpers
  fs: tolerate per-superblock freeze errors on shared devices
  fs: look up superblocks via the device table in fs_holder_ops
  ext4: open via dedicated fs bdev helpers
  btrfs: open via dedicated fs bdev helpers
  xfs: port to fs_bdev_file_open_by_path()
  fs: add dedicated block device open helpers for filesystems
  fs: maintain a global device-to-superblock table
  ocfs2: don't reset s_dev on dismount
  ext4: use anonymous devices for KUnit test superblocks
  fs, block: move blk_mode_t and fop_flags_t into <linux/types.h>
  super: take lock after last reference count
  super: convert s_count to refcount_t s_passive
  btrfs: deny freezing devices undergoing a replace
  ...

13 files changed:
1  2 
fs/btrfs/ioctl.c
fs/btrfs/volumes.c
fs/erofs/super.c
fs/f2fs/super.c
fs/internal.h
fs/namespace.c
fs/romfs/super.c
fs/super.c
fs/xfs/xfs_buf.c
fs/xfs/xfs_super.c
include/linux/fs.h
tools/testing/selftests/filesystems/.gitignore
tools/testing/selftests/filesystems/Makefile

Simple merge
Simple merge
Simple merge
diff --cc fs/f2fs/super.c
Simple merge
diff --cc fs/internal.h
Simple merge
diff --cc fs/namespace.c
index 3c382c2bdeec5856c5903848d9fbd8852b9482a4,7cef6dae08548541954b8cfd82a0622295b8788c..1ecd96c918b33581e0bdae88dc1e4978ebce2965
@@@ -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();
Simple merge
diff --cc fs/super.c
index 2c52c321885f780aeca83e1c9ecaadd74936e766,a62af36f7aaf122d690963e8d5fa679eea7ea53e..05e4431730387434bc54fda7c08a93f179b202f8
@@@ -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 */
Simple merge
index 63c4bcbe6c2bc427a7d21623e688833922693ae1,59865855b60fbb4ccaa8fb09f5555218a1dccd4a..4b2eeb7783f7e0b305fd7df2451a65bb2ccf71f2
@@@ -534,17 -534,14 +534,17 @@@ xfs_open_devices
   out_free_rtdev_targ:
        if (mp->m_rtdev_targp)
                xfs_free_buftarg(mp->m_rtdev_targp);
 +      mp->m_rtdev_targp = NULL;
 +      rtdev_file = NULL;      /* released by xfs_free_buftarg() */
   out_free_ddev_targ:
        xfs_free_buftarg(mp->m_ddev_targp);
 +      mp->m_ddev_targp = NULL;
   out_close_rtdev:
         if (rtdev_file)
-               bdev_fput(rtdev_file);
+               fs_bdev_file_release(rtdev_file, mp->m_super);
   out_close_logdev:
        if (logdev_file)
-               bdev_fput(logdev_file);
+               fs_bdev_file_release(logdev_file, mp->m_super);
        return error;
  }
  
Simple merge
index a78f894157de3389620877cc9c6ceee6397a9d6b,1bd53d54553c12e56e141503a8cf467aebb9b0a9..9eb185fb2f9ddb37df31f60baddf628046fff159
@@@ -5,4 -5,4 +5,5 @@@ fclo
  file_stressor
  anon_inode_test
  kernfs_test
 +idmapped_tmpfile
+ ustat_test
index a7ec2ba2dd83345192de149b75bdc6c40f4e22bb,bbdd40b167fac01e5383b98b1a3b0fb0b80873cb..03be337c1f351a72c5fd476812e7a55a89d86c32
@@@ -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