• Kent Overstreet's avatar
    bcachefs: delete faulty fastpath in bch2_btree_path_traverse_cached() · a24e6e71
    Kent Overstreet authored
    bch2_btree_path_traverse_cached() was previously checking if it could
    just relock the path, which is a common idiom in path traversal.
    
    However, it was using btree_node_relock(), not btree_path_relock();
    btree_path_relock() only succeeds if the path was in state
    BTREE_ITER_NEED_RELOCK.
    
    If the path was in state BTREE_ITER_NEED_TRAVERSE a full traversal is
    needed; this led to a null ptr deref in
    bch2_btree_path_traverse_cached().
    
    And the short circuit check here isn't needed, since it was already done
    in the main bch2_btree_path_traverse_one().
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    a24e6e71
btree_key_cache.c 26.2 KB