Commit 218e5e0c authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Fix locking assert

We now track whether a transaction is locked, and verify that we don't
have nodes locked when the transaction isn't locked; reorder relocks to
not pop the new assert.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 9e1a66e6
...@@ -424,16 +424,16 @@ static int btree_key_cache_fill(struct btree_trans *trans, ...@@ -424,16 +424,16 @@ static int btree_key_cache_fill(struct btree_trans *trans,
goto err; goto err;
} }
if (!bch2_btree_node_relock(trans, ck_path, 0)) { ret = bch2_trans_relock(trans);
if (ret) {
kfree(new_k); kfree(new_k);
trace_and_count(trans->c, trans_restart_relock_key_cache_fill, trans, _THIS_IP_, ck_path);
ret = btree_trans_restart(trans, BCH_ERR_transaction_restart_key_cache_fill);
goto err; goto err;
} }
ret = bch2_trans_relock(trans); if (!bch2_btree_node_relock(trans, ck_path, 0)) {
if (ret) {
kfree(new_k); kfree(new_k);
trace_and_count(trans->c, trans_restart_relock_key_cache_fill, trans, _THIS_IP_, ck_path);
ret = btree_trans_restart(trans, BCH_ERR_transaction_restart_key_cache_fill);
goto err; goto err;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment