mark_bbt_block_bad(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 struct
  • td β€” 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 🫢:


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