ubifs_rcvry_gc_commit(9)
π ubifs_rcvry_gc_commit(9) π
okay bestie, welcome to the Kernel API Manual entry for ubifs_rcvry_gc_commit(9) β this one is lowkey niche but highkey important for UBIFS recovery, iykyk. let's get into it π
π NAME π
ubifs_rcvry_gc_commit β recover the GC LEB number and run the commit. periodt.
β¨ SYNOPSIS β¨
int ubifs_rcvry_gc_commit (struct ubifs_info *c );
π ARGUMENTS π
cβ the UBIFS file-system description object. that's the whole vibe check for this arg π«Ά
π¦ DESCRIPTION π¦
okay so, out-of-place garbage collection literally always needs one empty LEB to start garbage collection with. no empty LEB, no GC, no slay. that LEB number lives in c->gc_lnum, and it gets written to the master node when you unmount.
but bestie, plot twist π: if the unmount was unclean, the value of gc_lnum recorded in the master node is out of date and cannot be used. so recovery has to step in and allocate an empty LEB for this purpose instead. the catch? there may not be enough empty space β and in that case, it must be possible to GC the dirtiest LEB into the GC head LEB. that's the whole balancing act, fr fr.
this function also runs the commit which causes the TNC updates from size-recovery and orphans to be written to the flash. that is important to ensure correct replay order for subsequent mounts β like, do not skip this, the replay order needs to eat and leave no crumbs π.
this function returns 0 on success and a negative error code on failure. easy math, no cap.
π SEE ALSO π
the Kernel file ./fs/ubifs/recovery.c is giving connected-cast energy, and these are all the siblings:
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)ubifs_recover_inl_heads(9)clean_an_unclean_leb(9)ubifs_clean_lebs(9)grab_empty_leb(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)
be sure to check them out, bestie β the whole recovery.c friend group is iconic π
byeee π«Ά this has been ubifs_rcvry_gc_commit(9), from the ./fs/ubifs source/version and 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