is_error_sane(9)
π NAME π
okay so this is the is_error_sane(9) page from the Kernel API Manual, and the main character energy is: is_error_sane β check whether a read error is sane. π
β¨ SYNOPSIS β¨
int is_error_sane (int err );
πΈ ARGUMENTS πΈ
errβ the code of the error that happened during reading.
π DESCRIPTION π
okay bestie, here's the tea: this is a helper function for 'ubi_eba_copy_leb', and it gets called when we cannot read data from the target PEB β like, an error err happened. If the error code is sane, then we treat this error as non-fatal. Otherwise the error is fatal and UBI will be switched to R/O mode later.
The idea is that we try not to switch to R/O mode if the read error is something which suggests there was a real read problem. E.g., -EIO. Or a memory allocation failed (-ENOMEM). Otherwise, it is safer to switch to R/O mode, simply because we do not know what happened at the MTD level, and we cannot handle this. E.g., the underlying driver may have become crazy, and it is safer to switch to R/O mode to preserve the data.
And bear in mind, this is about reading from the target PEB, i.e. the PEB which we have just written. π
π¦ SEE ALSO π¦
- Kernel file
./drivers/mtd/ubi/eba.c struct ubi_eba_entry(9)struct ubi_eba_table(9)ubi_next_sqnum(9)ubi_get_compat(9)ubi_eba_get_ldesc(9)ubi_eba_create_table(9)ubi_eba_destroy_table(9)ubi_eba_copy_table(9)ubi_eba_replace_table(9)ltree_lookup(9)ltree_add_entry(9)leb_read_lock(9)leb_read_unlock(9)leb_write_lock(9)leb_write_trylock(9)leb_write_unlock(9)ubi_eba_is_mapped(9)ubi_eba_unmap_leb(9)check_mapping(9)ubi_eba_read_leb(9)ubi_eba_read_leb_sg(9)try_recover_peb(9)recover_peb(9)try_write_vid_and_data(9)ubi_eba_write_leb(9)ubi_eba_write_leb_st(9)ubi_eba_copy_leb(9)print_rsvd_warning(9)self_check_eba(9)ubi_eba_init(9)
this page is signing off from ./drivers/mtd/ubi (source/version vibes) and October 2026 (date vibes) β is_error_sane(9) OUT, stay sane bestie π
β¨π«Ά
π¦ 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