fs_bdev_freeze(9)
π fs_bdev_freeze(9)
ok so this is a page out of the Kernel API Manual β yes bestie, the kernel has lore too π«Ά
β¨ NAME β¨
fs_bdev_freeze β the function that freezes, like, every superblock hanging off one block device π§
πΈ SYNOPSIS πΈ
int fs_bdev_freeze (struct block_device *bdev );
π ARGUMENTS π
bdevβ a block device. that's it. that's the whole argument. iconic minimalism tbh π
π¦ DESCRIPTION π¦
So picture this: you've got a block device, and you want every live superblock using it to justβ¦ stop. Freeze. Like a screenshot of the filesystem mid-vibe. That's what fs_bdev_freeze does β it freezes each live superblock that's using bdev. βοΈ
Now here's the part that's lowkey important: if a superblock owns several block devices, it gets frozen once per device, and it stays frozen until all of them are thawed. Not a single one. All. π€
And the block layer? bestie, it nests these freezes for you, so the count stays balanced. no leaks, no drift, no chaos. the way that it just works β¨
π RETURN π
Returns 0 on the happy path π β or, on a single-fs device, the error from (that) one superblock.
When several superblocks share bdev, a per-superblock failure gets swallowed π (yeah, see above), but a sync_blockdev failure is always reported. no swallowing that one, fr fr.
π₯ SEE ALSO π₯
all the friends in the Kernel file ./fs/super.c cinematic universe π
super_lock(9)alloc_super(9)deactivate_locked_super(9)deactivate_super(9)grab_super(9)retire_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_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)
mwah π that's the page! this one's from ./fs, dated October 2026 β go freeze something (responsibly) and thaw it after, bestie π§β‘οΈπ₯
π¦ 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