• Kent Overstreet's avatar
    bcachefs: Fix a trans path overflow in bch2_btree_delete_range_trans() · 685e0f0c
    Kent Overstreet authored
    bch2_btree_delete_range_trans() was using btree_trans_too_many_iters()
    to avoid path overflow, but this was buggy here (and also
    btree_trans_too_many_iters() is suspect in general).
    
    btree_trans_too_many_iters() only returns true when we're close to the
    maximum number of paths - within 8 - but extent insert/delete assumes
    that it can use more paths than that.
    
    Instead, we need to call bch2_trans_begin() on every loop iteration.
    Since we don't want to call bch2_trans_begin() (restarting the outer
    transaction) if the call was a no-op - if we had no work to do - we have
    to structure things a bit oddly.
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    685e0f0c
btree_update_leaf.c 45.6 KB