mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 00:04:15 +08:00
bcachefs: Fix bch2_move_btree()
bch2_trans_begin() is now required for transaction restarts. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
parent
56767d66e8
commit
4b09ef12e7
@ -883,9 +883,11 @@ static int bch2_move_btree(struct bch_fs *c,
|
||||
id++) {
|
||||
stats->btree_id = id;
|
||||
|
||||
for_each_btree_node(&trans, iter, id,
|
||||
id == start_btree_id ? start_pos : POS_MIN,
|
||||
BTREE_ITER_PREFETCH, b) {
|
||||
bch2_trans_node_iter_init(&trans, &iter, id, POS_MIN, 0, 0,
|
||||
BTREE_ITER_PREFETCH);
|
||||
|
||||
while (bch2_trans_begin(&trans),
|
||||
(b = bch2_btree_iter_peek_node(&iter))) {
|
||||
if (kthread && kthread_should_stop())
|
||||
break;
|
||||
|
||||
@ -911,6 +913,7 @@ static int bch2_move_btree(struct bch_fs *c,
|
||||
b->data->keys.seq, 0) ?: ret;
|
||||
next:
|
||||
bch2_trans_cond_resched(&trans);
|
||||
bch2_btree_iter_next_node(&iter);
|
||||
}
|
||||
bch2_trans_iter_exit(&trans, &iter);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user