ubifs_recover_inl_heads(9)
π ubifs_recover_inl_heads π
okay so bestie, welcome to the Kernel API Manual β this one is ubifs_recover_inl_heads(9) and it's lowkey a little cleanup baddie for the UBIFS file system. let's get into it β¨
π NAME π
ubifs_recover_inl_heads β recover index and LPT heads. that's it, that's the job π«Ά
β¨ SYNOPSIS β¨
int ubifs_recover_inl_heads (struct ubifs_info *c , void *sbuf );
πΈ ARGUMENTS πΈ
cβ the UBIFS file-system description object π like, the whole vibe of the fs in one structsbufβ a LEB-sized buffer to use π¦ it's exactly LEB-sized, no more no less
π¦ DESCRIPTION π¦
so the whole point, bestie: this function makes sure there is no data on the flash sitting at the index and LPT head locations. like, none. zero. clean slate energy β¨
it's dealing with the recovery of a half-completed journal commit π β which, ngl, is exactly the kind of mess you'd expect. here's the tea: UBIFS is careful, never to overwrite the last version of the index or the LPT. iconic, honestly π
because the index and the LPT are wandering trees (yes, wandering β they move around, main character energy), data from a half-completed commit will not be referenced anywhere in UBIFS. so where does that stray data end up? two places, both fine:
- in LEBs that are assumed to be empty, and that will be unmapped anyway before use π«Ά
- or in the index and LPT heads π
that's the whole picture. no cap.
this function returns 0 on success and a negative error code on failure π
π₯ SEE ALSO π₯
the kernel file is ./fs/ubifs/recovery.c and it's got a whole squad, fr fr:
is_empty(9)first_non_ff(9)get_master_node(9)write_rcvrd_mst_node(9)ubifs_recover_master_node(9)ubifs_write_rcvrd_mst_node(9)is_last_write(9)clean_buf(9)no_more_nodes(9)fix_unclean_leb(9)drop_last_group(9)drop_last_node(9)ubifs_recover_leb(9)get_cs_sqnum(9)ubifs_recover_log_leb(9)recover_head(9)clean_an_unclean_leb(9)ubifs_clean_lebs(9)grab_empty_leb(9)ubifs_rcvry_gc_commit(9)struct size_entry(9)add_ino(9)find_ino(9)remove_ino(9)ubifs_destroy_size_tree(9)ubifs_recover_size_accum(9)fix_size_in_place(9)inode_fix_size(9)ubifs_recover_size(9)
mwah π that's the whole page. this one lives under ./fs/ubifs, dated October 2026, and it's page ubifs_recover_inl_heads(9) of the Kernel API Manual β go off, you understood it perfectly πβ¨
π¦ 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