self_check_write(9)
π self_check_write β make sure write succeeded.
okay bestie, welcome to self_check_write(9) from the Kernel API Manual β yes that's the whole title, we're getting straight into it π
β¨ SYNOPSIS β¨
int self_check_write (struct ubi_device *ubi , const void *buf , int
pnum , int offset , int len );
π«Ά ARGUMENTS π«Ά
ubiβ the UBI device description object. like, the whole vibe of the device we're dealing with β¨bufβ the buffer holding the data that were written. this is the receipts, keep them πpnumβ the physical eraseblock number that the data were written to. where it went, bestie πoffsetβ the offset within that physical eraseblock where the data were written to. precise placement, we love to see it πlenβ how many bytes were written. count 'em π’
π¦ DESCRIPTION π¦
so here's the tea β β this function reads back the data that were recently written and compares it against the original data buffer. and the data have to match. no cap, they gotta match fr fr.
If the data match, it returns zero πΈ. If they don't match β or if something just fails along the way β it returns a negative error code π.
literally a vibe check for your writes. if the write didn't slay, you're getting a negative number back, periodt.
π₯ SEE ALSO π₯
Kernel file ./drivers/mtd/ubi/io.c β and the whole squad of related functions, all of them, no skipping π:
ubi_io_read(9)ubi_io_write(9)do_sync_erase(9)torture_peb(9)nor_erase_prepare(9)ubi_io_sync_erase(9)ubi_io_is_bad(9)ubi_io_mark_bad(9)validate_ec_hdr(9)ubi_io_read_ec_hdr(9)ubi_io_write_ec_hdr(9)validate_vid_hdr(9)ubi_io_read_vid_hdr(9)ubi_io_write_vid_hdr(9)self_check_not_bad(9)self_check_ec_hdr(9)self_check_peb_ec_hdr(9)self_check_vid_hdr(9)self_check_peb_vid_hdr(9)ubi_self_check_all_ff(9)
and that's the whole page, bestie π come back any time β this one lives at ./drivers/mtd/ubi and it's dated October 2026. mwah πβ¨
π¦ 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