Skip to content

Commit b04974f

Browse files
author
Kent Overstreet
committed
bcachefs: Fix srcu lock warning in btree_update_nodes_written()
We don't want to be holding the srcu lock while waiting on btree write completions - easily fixed. Reported-by: Janpieter Sollie <[email protected]> Signed-off-by: Kent Overstreet <[email protected]>
1 parent 4fd509c commit b04974f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/bcachefs/btree_update_interior.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,9 +681,11 @@ static void btree_update_nodes_written(struct btree_update *as)
681681

682682
b = as->old_nodes[i];
683683

684+
bch2_trans_begin(trans);
684685
btree_node_lock_nopath_nofail(trans, &b->c, SIX_LOCK_read);
685686
seq = b->data ? b->data->keys.seq : 0;
686687
six_unlock_read(&b->c.lock);
688+
bch2_trans_unlock_long(trans);
687689

688690
if (seq == as->old_nodes_seq[i])
689691
wait_on_bit_io(&b->flags, BTREE_NODE_write_in_flight_inner,

0 commit comments

Comments
 (0)