retire_super(9)
π retire_super(9) π
okay bestie, welcome to retire_super β straight out of the Kernel API Manual, and honestly? it's giving "quietly shutting the door on a superblock so nobody else can walk in" β¨
β¨ NAME β¨
retire_super β literally prevents a superblock from being reused π
πΈ SYNOPSIS πΈ
void retire_super (struct super_block *sb );
π¦ ARGUMENTS π¦
sbβ the superblock you're retiring. that's it, that's the whole vibe π«Ά
π DESCRIPTION π
okay so here's the tea π₯ this function marks the superblock to be ignored in the superblock test, which prevents it from being reused for any new mounts. no cap, once it's retired, it's retired.
and if the superblock has a private bdi, it also unregisters it β but bestie, listen, it does not reduce the refcount of the superblock, and that's on purpose, to prevent potential races. the refcount is reduced by generic_shutdown_super instead. iykyk π
β οΈ super important: the function can not be called concurrently with generic_shutdown_super. like, do not do that. fr fr.
good news though β it is safe to call the function multiple times, and subsequent calls have no effect. so if you're paranoid and call it twice, it's fine, it's giving "no thoughts, head empty" π
one more thing, the marker will affect the re-use only for block-device-based superblocks. other superblocks will still get marked if this function is used, but that will not affect their reusability. so like, marked β locked, y'know? π
π SEE ALSO π
kernel file ./fs/super.c β plus the whole friend group π
super_lock(9)alloc_super(9)deactivate_locked_super(9)deactivate_super(9)grab_super(9)generic_shutdown_super(9)sget_fc(9)iterate_supers_type(9)reconfigure_super(9)emergency_thaw_all(9)get_anon_bdev(9)sget_dev(9)fs_bdev_freeze(9)fs_bdev_thaw(9)fs_bdev_file_open_by_dev(9)fs_bdev_file_open_by_path(9)fs_bdev_unregister(9)fs_bdev_file_release(9)get_tree_bdev_flags(9)get_tree_bdev(9)vfs_get_tree(9)sb_wait_write(9)freeze_super(9)thaw_super(9)
that's the whole page bestie, go forth and retire those superblocks responsibly π§π
mwah π β this one lives in ./fs, dated October 2026, and you'll find it filed under retire_super(9) forever and ever π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms