bcachefs: Don't generate alloc updates to invalid buckets
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
@@ -604,6 +604,13 @@ static int bch2_trigger_pointer(struct btree_trans *trans,
|
||||
}
|
||||
|
||||
struct bpos bucket = PTR_BUCKET_POS(ca, &p.ptr);
|
||||
if (!bucket_valid(ca, bucket.offset)) {
|
||||
if (insert) {
|
||||
bch2_dev_bucket_missing(ca, bucket.offset);
|
||||
ret = -BCH_ERR_trigger_pointer;
|
||||
}
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (flags & BTREE_TRIGGER_transactional) {
|
||||
struct bkey_i_alloc_v4 *a = bch2_trans_start_alloc_update(trans, bucket, 0);
|
||||
|
||||
Reference in New Issue
Block a user