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 <janpieter.sollie@edpnet.be> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
4fd509c10f
commit
b04974f759
1 changed files with 2 additions and 0 deletions
|
@ -681,9 +681,11 @@ static void btree_update_nodes_written(struct btree_update *as)
|
||||||
|
|
||||||
b = as->old_nodes[i];
|
b = as->old_nodes[i];
|
||||||
|
|
||||||
|
bch2_trans_begin(trans);
|
||||||
btree_node_lock_nopath_nofail(trans, &b->c, SIX_LOCK_read);
|
btree_node_lock_nopath_nofail(trans, &b->c, SIX_LOCK_read);
|
||||||
seq = b->data ? b->data->keys.seq : 0;
|
seq = b->data ? b->data->keys.seq : 0;
|
||||||
six_unlock_read(&b->c.lock);
|
six_unlock_read(&b->c.lock);
|
||||||
|
bch2_trans_unlock_long(trans);
|
||||||
|
|
||||||
if (seq == as->old_nodes_seq[i])
|
if (seq == as->old_nodes_seq[i])
|
||||||
wait_on_bit_io(&b->flags, BTREE_NODE_write_in_flight_inner,
|
wait_on_bit_io(&b->flags, BTREE_NODE_write_in_flight_inner,
|
||||||
|
|
Loading…
Add table
Reference in a new issue