check_leaf(9)
π check_leaf(9) β the kernel API manual, bestie edition π
okay so this is check_leaf, from section 9 of the Kernel API Manual, and honestly? she's a little workhorse and she deserves her flowers πΈ
β¨ NAME β¨
check_leaf β check leaf node. that's it, that's the vibe. a leaf node inspector π
π¦ SYNOPSIS π¦
int check_leaf (struct ubifs_info *c , struct ubifs_zbranch *zbr , void
*priv );
π ARGUMENTS π
cβ the UBIFS file-system description object. your whole filesystem's little personality profile, basically πzbrβ the zbranch of the leaf node we're checking. like, this specific leaf, bestie πprivβ FS checking information. the private stash of info the checker carries around π
π₯ DESCRIPTION π₯
okay so real talk β this is a helper function for dbg_check_filesystem, and it gets called for every single leaf node while walking the indexing tree. every. single. one. no skipping, no cap π
here's what she's checking when she shows up:
- that the leaf node referred from the indexing tree actually exists β like, hello?? are you real?? π
- that it has the correct CRC β integrity check, periodt β¨
- and she does some other basic validation too, because she's thorough like that π
and she's not just a bouncer, she's also a builder π§ β this function is responsible for building an RB-tree of inodes, and it adds all the inodes into that RB-tree. every one.
on top of that, she calculates the reference count, size, etc. for each inode, so that later on those numbers can be compared against the info stored inside the inodes themselves and any possible inconsistencies get caught. detective energy, lowkey π
returns zero in case of success and a negative error code in case of failure. so like, 0 = slay, negative = something's off π
π SEE ALSO π
the kernel file ./fs/ubifs/debug.c, plus this whole friend group right here β they all come as a set, iykyk:
ubifs_dump_index(9)dbg_save_space_info(9)dbg_check_space_info(9)dbg_check_synced_i_size(9)dbg_check_key_order(9)dbg_check_znode(9)dbg_check_tnc(9)dbg_walk_index(9)add_size(9)dbg_check_idx_size(9)struct fsck_inode(9)struct fsck_data(9)add_inode(9)search_inode(9)read_add_inode(9)free_inodes(9)check_inodes(9)dbg_check_filesystem(9)dbg_check_data_nodes_order(9)dbg_check_nondata_nodes_order(9)provide_user_output(9)interpret_user_input(9)dbg_debugfs_init_fs(9)dbg_debugfs_exit_fs(9)dbg_debugfs_init(9)dbg_debugfs_exit(9)ubifs_debugging_init(9)ubifs_debugging_exit(9)
ngl bestie, if you're poking at leaf nodes you're already deep in the UBIFS debugging trenches β read the whole list, they're all neighbours π
and that's the page! π«Ά this one lives in ./fs/ubifs, dated October 2026 β mark your calendar, she's iconic πβ
π¦ 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