add_corrupted(9)
π 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 π
find_or_add_av(9)ubi_find_or_add_av(9)ubi_alloc_aeb(9)ubi_free_aeb(9)add_to_list(9)add_fastmap(9)validate_vid_hdr(9)add_volume(9)ubi_compare_lebs(9)ubi_add_to_av(9)ubi_add_av(9)ubi_find_av(9)ubi_remove_av(9)early_erase_peb(9)ubi_early_get_peb(9)check_corruption(9)scan_peb(9)late_analysis(9)destroy_av(9)destroy_ai(9)scan_all(9)scan_fast(9)ubi_attach(9)self_check_ai(9)
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
- 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