super: convert to a plain hashtable
Get series with b4
b4 am [email protected] change-id 20261011-work-super-dev_hash-e30f79361408Versions newest first
- v1 Latest2 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | selftests/filesystems: add a test for freezing a shared block devicetools/ tools/ tools/ +1 more | +482 | 0 replies | |
| 2/2 | super: convert to plain hashtableblock/ fs/ fs/ +2 more | +145 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/2] super: convert to a plain hashtable
This sits on top of the superblock fixes for v7.3.
Convert the rhltable to a plain hashtable under a spinlock. The walks keep their place with a cursor entry in the chain. A claim is unhashed the moment it's dropped and a walk that finds a superblock that isn't born yet waits for it to be born or to die and looks again. Since hashing can't fail anymore the entry for the superblock's own s_dev is embedded in struct super_block and the preallocation in alloc_super() goes away. This all simplifies things quite a lot.
It also fixes a btrfs bug where fs_bdev_freeze() ended up freezing a btrfs filesystem through a stale member that open_ctree() had already released while the freeze was waiting for SB_BORN. The resume doesn't find a holder for that device anymore so the filesystem stays frozen for good.
The selftest freezes a device that several erofs superblocks share. That's the one case where a device legitimately carries claims from more than one superblock and it checks that a suspend freezes each of them exactly once and that mounts coming and going under a suspended device leave nothing frozen behind.
I modeled the table in TLA+ and checked the real list code with CBMC. Both agree with the design.
---
Christian Brauner (2):
selftests/filesystems: add a test for freezing a shared block device
super: convert to plain hashtable
block/bdev.c | 2 +- fs/internal.h | 1 - fs/namespace.c | 2 - fs/super.c | 332 ++++++-------- include/linux/fs/super_types.h | 11 +- .../selftests/filesystems/freeze/.gitignore | 1 + .../testing/selftests/filesystems/freeze/Makefile | 2 +- tools/testing/selftests/filesystems/freeze/config | 1 + .../filesystems/freeze/shared_bdev_test.c | 479 +++++++++++++++++++++ 9 files changed, 627 insertions(+), 204 deletions(-)
---
base-commit: 16efce55f70b6093dbe53bffb8e79fb0e08a95b6
change-id: 20261011-work-super-dev_hash-e30f79361408