add_corrupted(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… add_corrupted(9) β€” a Kernel API Manual moment

okay so bestie, welcome to add_corrupted(9), straight out of the Kernel API Manual ✨ this one lives in the kernel, and it's all about one very specific little job: shoving a corrupted physical eraseblock into the list of corrupted things. iconic honestly πŸŽ€


🌸 NAME

add_corrupted β€” add a corrupted physical eraseblock 🫢


⭐ SYNOPSIS

int add_corrupted (struct ubi_attach_info *ai , int pnum , int ec );

πŸ¦‹ ARGUMENTS

  • ai β€” attaching information, the whole vibe context you're working in πŸ’«
  • pnum β€” physical eraseblock number to add, like literally which one πŸ“Œ
  • ec β€” the erase counter of that physical eraseblock, bestie πŸ”’

πŸ’– DESCRIPTION

so what this function does is: it allocates a 'struct ubi_ainf_peb' object for a corrupted physical eraseblock pnum, and adds it to the 'corr' list. periodt πŸ’…

the corruption was presumably not caused by a power cut β€” that's the assumption we're rolling with here, no cap 😌

returns zero in case of success and a negative error code in case of failure. that's the whole deal, slay 🌈


πŸ”₯ SEE ALSO

Kernel file ./drivers/mtd/ubi/attach.c β€” go read it, iykyk πŸ‘‘


ngl the whole friend group of functions is right there β€” go say hi to all of them, they're all in ./drivers/mtd/ubi too πŸ’€πŸ«Ά

k that's the page bestie, mwah πŸ’‹ this little number comes to you from ./drivers/mtd/ubi, dated October 2026 β€” bye, love you, go handle your eraseblocks responsibly πŸ§šβ€β™€οΈπŸ’œ

πŸ“¦ where this page comes from