blk_stack_limits(9)
π blk_stack_limits(9) π
okay so this is a page straight out of the Kernel API Manual, and it's about blk_stack_limits β the little function that keeps stacked devices from having a whole identity crisis about block sizes. strap in bestie π
β¨ NAME β¨
blk_stack_limits β adjust queue_limits for stacked devices π¦
β¨ SYNOPSIS β¨
int blk_stack_limits (struct queue_limits *t , struct queue_limits *b ,
sector_t start );
β¨ ARGUMENTS β¨
tβ the stacking driver limits π like, this is the top device's limits, okurrrbβ the underlying queue limits, aka the bottom/component device's limits π«Άstartβ the first data sector within that component device β
β¨ DESCRIPTION β¨
so what's the tea β β this function is what stacking drivers like MD and DM call to make sure every single component device has compatible block sizes and alignments. no cap, that's literally the whole job.
here's the vibe: the stacking driver has to bring its own queue_limits struct (that's the top one π), and then it calls the stacking function over and over, once for every bottom / component device π§ the stacking function then tries its absolute hardest to combine all those values and make sure everything lines up properly. it's giving matchmaker but for sectors π
πΈ the return value, bestie πΈ
it returns 0 when the top and bottom queue_limits are compatible. slay β¨
and heads up β the top device's block sizes and alignment offsets may get adjusted to make sure they're aligned with the bottom device. so don't be shocked if your top limits come out looking a little different than they went in π
but if there are genuinely no compatible sizes and alignments to be found? it returns -1 π and the resulting top queue_limits will have the misaligned flag set β which is the kernel's way of saying "the alignment_offset is undefined, do not trust it, it's giving undefined behaviour energy" π
fr fr β when that misaligned flag is set, the alignment_offset is undefined. that's not a vibe, that's a warning. π¨
β¨ SEE ALSO β¨
go check out the kernel file ./block/blk-settings.c and these iconic little friends π«Ά:
blk_set_stacking_limits(9)queue_limits_commit_update(9)queue_limits_commit_update_frozen(9)queue_limits_set(9)queue_limits_stack_bdev(9)queue_limits_stack_integrity(9)blk_set_queue_depth(9)
okay that's the whole page, no notes π
this one's living in ./block, stamped October 2026, and it's blk_stack_limits(9) β go stack those devices responsibly bestie, 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