summaryrefslogtreecommitdiff
path: root/fs/bcachefs/recovery.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-03-09 16:15:54 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:36 -0400
commitf6d0368e06be2c889a4ce1097e20606cededd775 (patch)
treeb7d358edab8f8c224833e76b8bf1a3b21d4f74d1 /fs/bcachefs/recovery.c
parenta7b46a3db0931e88f837ae741afe9770c6fede49 (diff)
downloadlwn-f6d0368e06be2c889a4ce1097e20606cededd775.tar.gz
lwn-f6d0368e06be2c889a4ce1097e20606cededd775.zip
bcachefs: Traverse iterator in journal replay
This fixes a bug where we end up spinning in journal replay - in theory this shouldn't be necessary though, transaction reset should be re-traversing all iterators. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/recovery.c')
-rw-r--r--fs/bcachefs/recovery.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index 3b9c20cf389a..712a6b1fd968 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -417,15 +417,17 @@ static int __bch2_journal_replay_key(struct btree_trans *trans,
enum btree_id id, struct bkey_i *k)
{
struct btree_iter *iter;
+ int ret;
iter = bch2_trans_get_iter(trans, id, bkey_start_pos(&k->k),
BTREE_ITER_INTENT);
if (IS_ERR(iter))
return PTR_ERR(iter);
- bch2_trans_update(trans, iter, k, BTREE_TRIGGER_NORUN);
+ ret = bch2_btree_iter_traverse(iter) ?:
+ bch2_trans_update(trans, iter, k, BTREE_TRIGGER_NORUN);
bch2_trans_iter_put(trans, iter);
- return 0;
+ return ret;
}
static int bch2_journal_replay_key(struct bch_fs *c, enum btree_id id,