summaryrefslogtreecommitdiff
path: root/libbcachefs/alloc_background.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-04-21 04:02:48 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-04-21 04:02:48 -0400
commitfbe4e11c2615b65a0f91941b1e85d6d5ca8ebaf4 (patch)
treeedc98cf90fa0a1e36da10b50129f9ce6af050957 /libbcachefs/alloc_background.c
parent0f37f9f05fa4b3b45b419cf83e6b8a2c5b814ebb (diff)
Update bcachefs sources to 2115a2ffde bcachefs: Kill bch2_verify_bucket_evacuated()
Diffstat (limited to 'libbcachefs/alloc_background.c')
-rw-r--r--libbcachefs/alloc_background.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/libbcachefs/alloc_background.c b/libbcachefs/alloc_background.c
index 8ce2027d..81620870 100644
--- a/libbcachefs/alloc_background.c
+++ b/libbcachefs/alloc_background.c
@@ -1362,17 +1362,21 @@ static int bch2_check_bucket_gens_key(struct btree_trans *trans,
u64 start = bucket_gens_pos_to_alloc(k.k->p, 0).offset;
u64 end = bucket_gens_pos_to_alloc(bpos_nosnap_successor(k.k->p), 0).offset;
u64 b;
- bool need_update = false;
+ bool need_update = false, dev_exists;
struct printbuf buf = PRINTBUF;
int ret = 0;
BUG_ON(k.k->type != KEY_TYPE_bucket_gens);
bkey_reassemble(&g.k_i, k);
- if (fsck_err_on(!bch2_dev_exists2(c, k.k->p.inode), c,
- "bucket_gens key for invalid device:\n %s",
- (bch2_bkey_val_to_text(&buf, c, k), buf.buf))) {
- ret = bch2_btree_delete_at(trans, iter, 0);
+ /* if no bch_dev, skip out whether we repair or not */
+ dev_exists = bch2_dev_exists2(c, k.k->p.inode);
+ if (!dev_exists) {
+ if (fsck_err_on(!dev_exists, c,
+ "bucket_gens key for invalid device:\n %s",
+ (bch2_bkey_val_to_text(&buf, c, k), buf.buf))) {
+ ret = bch2_btree_delete_at(trans, iter, 0);
+ }
goto out;
}