bdev_deny_freeze(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… bdev_deny_freeze(9) β€” the Kernel API Manual, bestie edition πŸŽ€

okay so real talk, this is a page from the Kernel API Manual and the function's whole personality is bdev_deny_freeze β€” it's the vibe-check bouncer for block devices. let's get into it ✨


🌸 NAME 🌸

bdev_deny_freeze β€” makes a block device unfreezable, no cap 🧊🚫


✨ SYNOPSIS ✨

int bdev_deny_freeze (struct block_device *bdev );

like yes that's the whole signature, she's lowkey minimal πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • bdev β€” the block device. that's it. that's the whole argument. the main character of this function fr 🫢

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the tea β˜• β€” bdev_deny_freeze reserves bdev against bdev_freeze, and it does it the exact same way deny_write_access reserves a file against writers. iconic lineage, honestly πŸ‘‘

the secret sauce is bd_fsfreeze_count, which is sign-encoded (yes, sign-encoded, she contains multitudes):

  • > 0 counts the active freezes ❄️
  • < 0 counts the deniers πŸ™…β€β™€οΈ

so a deny only succeeds while no freeze is in progress. like, you cannot barge in mid-freeze, that's not the move. and while the deny is held, bdev_freeze returns -EBUSY β€” the door is locked from the inside πŸšͺπŸ”’

πŸ’– always pair this with bdev_allow_freeze β€” you cannot just leave it denied forever, that's not slay behaviour, that's a leak.

and why do we care?? because when a filesystem is removing, adding, or replacing a member device, it denies freezes on that device for the duration. the whole point is that a claim a freeze walk might act on is never torn down behind the freezer's back 🫣 β€” no sneaky surprises, no backstabbing, we don't do that here.

one thing to keep in your notes app πŸ“: the deny is device-scoped, not (device, superblock)-scoped. so if a device is shared by several superblocks, it gets refused for all of them. no sharing, no splitting, it's all-or-nothing energy πŸ’€

and for the record β€” no in-tree filesystem removes a shared claim from a live superblock. that's just not a thing that happens. periodt. πŸŽ€


πŸ”₯ RETURN πŸ”₯

  • 0 β€” we're so back, the deny landed βœ…
  • -EBUSY β€” the device is currently frozen, try again later bestie 😭

🌈 SEE ALSO 🌈

the lore continues in the kernel file ./block/bdev.c β€” go read it, iykyk πŸ“–βœ¨


and that's the page!! πŸŽ€ from the ./block corner of the world, dated October 2026 β€” mwah, go freeze responsibly, ily, bye πŸ’œπŸ¦‹β­

πŸ“¦ where this page comes from