mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 08:14:15 +08:00
bcachefs: Run merges at BCH_WATERMARK_btree
This fixes a deadlock where the interior update path during journal replay ends up doing a ton of merges on the backpointers btree, and deadlocking. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
9e203c43dc
commit
9054ef2ea9
@ -1926,6 +1926,8 @@ int __bch2_foreground_maybe_merge(struct btree_trans *trans,
|
|||||||
BUG_ON(!trans->paths[path].should_be_locked);
|
BUG_ON(!trans->paths[path].should_be_locked);
|
||||||
BUG_ON(!btree_node_locked(&trans->paths[path], level));
|
BUG_ON(!btree_node_locked(&trans->paths[path], level));
|
||||||
|
|
||||||
|
flags &= ~BCH_WATERMARK_MASK;
|
||||||
|
|
||||||
b = trans->paths[path].l[level].b;
|
b = trans->paths[path].l[level].b;
|
||||||
|
|
||||||
if ((sib == btree_prev_sib && bpos_eq(b->data->min_key, POS_MIN)) ||
|
if ((sib == btree_prev_sib && bpos_eq(b->data->min_key, POS_MIN)) ||
|
||||||
@ -2071,6 +2073,10 @@ err:
|
|||||||
bch2_path_put(trans, new_path, true);
|
bch2_path_put(trans, new_path, true);
|
||||||
bch2_path_put(trans, sib_path, true);
|
bch2_path_put(trans, sib_path, true);
|
||||||
bch2_trans_verify_locks(trans);
|
bch2_trans_verify_locks(trans);
|
||||||
|
if (ret == -BCH_ERR_journal_reclaim_would_deadlock)
|
||||||
|
ret = 0;
|
||||||
|
if (!ret)
|
||||||
|
ret = bch2_trans_relock(trans);
|
||||||
return ret;
|
return ret;
|
||||||
err_free_update:
|
err_free_update:
|
||||||
bch2_btree_node_free_never_used(as, trans, n);
|
bch2_btree_node_free_never_used(as, trans, n);
|
||||||
|
Loading…
Reference in New Issue
Block a user