Skip to content

Commit eca5b56

Browse files
author
Kent Overstreet
committed
bcachefs: Don't generate alloc updates to invalid buckets
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent e7f1a52 commit eca5b56

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

fs/bcachefs/buckets.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,13 @@ static int bch2_trigger_pointer(struct btree_trans *trans,
604604
}
605605

606606
struct bpos bucket = PTR_BUCKET_POS(ca, &p.ptr);
607+
if (!bucket_valid(ca, bucket.offset)) {
608+
if (insert) {
609+
bch2_dev_bucket_missing(ca, bucket.offset);
610+
ret = -BCH_ERR_trigger_pointer;
611+
}
612+
goto err;
613+
}
607614

608615
if (flags & BTREE_TRIGGER_transactional) {
609616
struct bkey_i_alloc_v4 *a = bch2_trans_start_alloc_update(trans, bucket, 0);

0 commit comments

Comments
 (0)