mark_bbt_block_bad(9)
π mark_bbt_block_bad(9) β like, the kernel API manual bestie π
okay so this is mark_bbt_block_bad, and yes it lives in the Kernel API Manual (I checked, it's giving official π). It's a kernel function page, so there's no OPTIONS section to obsess over β just args, vibes, and a truly unhinged number of SEE ALSOs. Let's go β¨
πΈ NAME πΈ
mark_bbt_block_bad β marks one of the blocks reserved for BBT as bad π₯ like, yes, it's as real as it sounds
β SYNOPSIS β
void mark_bbt_block_bad (struct nand_chip *this , struct nand_bbt_descr
*td , int chip , int block );
not me copy-pasting the signature exactly bc that's literally the whole point π
π¦ ARGUMENTS π¦
thisβ the NAND device, obvs π«Ά this is your main character structtdβ the BBT description, iykyk πchipβ the CHIP selector, like which chip we're talking about π₯blockβ the BBT block to mark, the one getting the bad-block glow-down π
π§ DESCRIPTION π§
okay so plot twist: blocks that are reserved for BBT can still go bad π and this function is the little helper that marks those blocks as bad.
it's not just a label-maker though, she does three things and honestly? iconic:
- it takes care of updating the in-memory BBT π
- it marks the block as bad using a bad block marker π
- it invalidates the associated
td->pages[]entry β¨
so yeah. reserved does not mean immortal, and this is the function that handles the reality check. periodt π
π SEE ALSO π
the kernel file ./drivers/mtd/nand/raw/nand_bbt.c, plus this absolute friend group of functions β not me listing every single one, but also I have to, so here we go π«Ά:
check_pattern(9)check_short_pattern(9)add_marker_len(9)read_bbt(9)read_abs_bbt(9)scan_read_oob(9)read_abs_bbts(9)create_bbt(9)search_bbt(9)search_read_bbts(9)get_bbt_block(9)write_bbt(9)nand_memory_bbt(9)check_create(9)nand_update_bbt(9)mark_bbt_region(9)verify_bbt_descr(9)nand_scan_bbt(9)nand_create_badblock_pattern(9)nand_create_bbt(9)nand_isreserved_bbt(9)nand_isbad_bbt(9)nand_markbad_bbt(9)
ngl, that SEE ALSO list ate and left no crumbs π₯ every single one is staying, I don't make the rules (I do make the rules, but the rule is "keep every detail", so π)
and that's the page!! source situation is ./drivers/mtd/nand/raw and it's dated October 2026 β so go forth and mark those BBT blocks bad, bestie, you're literally built for this πΈππ¦
π¦ 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