__add_badblock_range(9)
π
__add_badblock_range β no cap, the kernel manpage
okay so bestie, welcome to the Kernel API Manual, section 9, and the function we're stanning today is __add_badblock_range. lowercase name, double underscore, main character energy fr fr π
β¨ NAME β¨
__add_badblock_range β converts a physical address range into bad sectors. that's it, that's the whole vibe π¦
πΈ SYNOPSIS πΈ
void __add_badblock_range (struct badblocks *bb, u64 ns_offset, u64 len);
she returns void, she takes three things, she does not miss π₯
π§ ARGUMENTS π§
bbβ thebadblocksinstance you're populating, aka the little bad-sector guest list you're adding names to πns_offsetβ the namespace offset where the error range begins, and yes bestie it's measured in bytes πlenβ how many bytes of badrange are getting added. the size of the problem, basically π
π DESCRIPTION π
okay so here's the whole thing: this function assumes the range you hand it with (ns_offset, len) is already chilling inside the bounds of physical addresses for this namespace. like, it has to lie in the interval
[ns_start, ns_start + ns_size)
that's the assumption, that's the assignment, and it is not out here double-checking for you π it's giving "trust me bestie" energy, so make sure your range actually belongs there before you call her π
π«Ά SEE ALSO π«Ά
- Kernel file
./drivers/nvdimm/badrange.cβ go read the source, iykyk π nvdimm_badblocks_populate(9)β her friend, also iconic β
so yeah, that's the whole page, no notes π
and for the cute sign-off: this one comes from ./drivers/nvdimm, October 2026, and it literally says __add_badblock_range(9) right there in the corner like a little signature. slay, periodt ππ
π¦ 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