fallible_resolve_collision(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… fallible_resolve_collision(9) β€” Kernel API Manual πŸ’…

✨ NAME ✨

fallible_resolve_collision β€” resolve a collision even if nodes are missing. πŸ’–

πŸŽ€ SYNOPSIS πŸŽ€

int fallible_resolve_collision (struct ubifs_info *c , const union
       ubifs_key *key , struct ubifs_znode **zn , int *n , const struct
       fscrypt_name *nm , int adding );

🌸 ARGUMENTS 🌸

  • c β€” UBIFS file-system description object.
  • key β€” key.
  • zn β€” znode is returned here.
  • n β€” branch number is passed and returned here.
  • nm β€” name of directory entry.
  • adding β€” indicates caller is adding a key to the TNC.

πŸ¦‹ DESCRIPTION πŸ¦‹

This is the fallible version of the resolve_collision function, and the whole point is that it does not panic if one of the nodes referred to by TNC does not exist on the media. This may happen when replaying the journal if a deleted node was Garbage-collected and the commit was not done. A branch that refers to a node that is not present is called a dangling branch. The following are the return codes for this function:

  • if nm was found, 1 is returned and zn and n are set to the found branch;
  • if we are adding and nm was not found, 0 is returned;
  • if we are not adding and nm was not found, but a dangling branch was found, then 1 is returned and zn and n are set to the dangling branch;
  • a negative error code is returned in case of failure.
bestie, keep those return codes straight: found = 1, adding-but-not-found = 0, not-adding-but-dangling-found = 1 with zn/n set to the dangling branch, and failure = negative error code. periodt. πŸ’…

πŸ’œ SEE ALSO πŸ’œ

Kernel file ./fs/ubifs/tnc.c β€” insert_old_idx(9), insert_old_idx_znode(9), ins_clr_old_idx_znode(9), destroy_old_idx(9), copy_znode(9), add_idx_dirt(9), replace_znode(9), dirty_cow_znode(9), lnc_add(9), lnc_free(9), tnc_read_hashed_node(9), try_read_node(9), fallible_read_node(9), matches_name(9), get_znode(9), tnc_next(9), tnc_prev(9), resolve_collision(9), fallible_matches_name(9), matches_position(9), resolve_collision_directly(9), dirty_cow_bottom_up(9), ubifs_lookup_level0(9), lookup_level0_dirty(9), maybe_leb_gced(9), ubifs_tnc_locate(9), ubifs_tnc_get_bu_keys(9), read_wbuf(9), validate_data_node(9), ubifs_tnc_bulk_read(9), do_lookup_nm(9), ubifs_tnc_lookup_nm(9), ubifs_tnc_lookup_dh(9), correct_parent_keys(9), insert_zbranch(9), tnc_insert(9), ubifs_tnc_add(9), ubifs_tnc_replace(9), ubifs_tnc_add_nm(9), tnc_delete(9), ubifs_tnc_remove(9), ubifs_tnc_remove_nm(9), ubifs_tnc_remove_dh(9), key_in_range(9), ubifs_tnc_remove_range(9), ubifs_tnc_remove_ino(9), ubifs_tnc_next_ent(9), tnc_destroy_cnext(9), ubifs_tnc_close(9), left_znode(9), right_znode(9), lookup_znode(9), is_idx_node_in_tnc(9), is_leaf_node_in_tnc(9), ubifs_tnc_has_node(9), ubifs_dirty_idx_node(9), dbg_check_inode_size(9)


source: ./fs/ubifs · date: October 2026 · page: fallible_resolve_collision(9) 🫢

πŸ“¦ where this page comes from