bdev_deny_freeze(9)
π 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):
> 0counts the active freezes βοΈ< 0counts 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 πβ¨
bdev_validate_blocksize(9)bdev_freeze(9)bdev_thaw(9)bdev_allow_freeze(9)bd_may_claim(9)bd_prepare_to_claim(9)bd_finish_claiming(9)bd_abort_claiming(9)bdev_open(9)bdev_yield_claim(9)bdev_fput(9)lookup_bdev(9)bdev_mark_dead(9)
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
- 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