fs_bdev_freeze(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 πŸ‘‘


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