bcachefs: bch2_bucket_ref_update()
If we hit an inconsistency when updating allocation information, we don't want to fail the update if it's for a deletion - only if it's for a new key. Rename check_bucket_ref() -> bucket_ref_update() so we can centralize the logic to do this. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
@ -243,13 +243,13 @@ static int __mark_stripe_bucket(struct btree_trans *trans,
|
||||
}
|
||||
}
|
||||
|
||||
ret = bch2_check_bucket_ref(trans, s.s_c, ptr, sectors, data_type,
|
||||
bucket_gen, *bucket_data_type,
|
||||
*bucket_dirty_sectors);
|
||||
if (ret)
|
||||
goto err;
|
||||
|
||||
*bucket_dirty_sectors += sectors;
|
||||
if (sectors) {
|
||||
ret = bch2_bucket_ref_update(trans, s.s_c, ptr, sectors, data_type,
|
||||
bucket_gen, *bucket_data_type,
|
||||
bucket_dirty_sectors);
|
||||
if (ret)
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!deleting) {
|
||||
*bucket_stripe = s.k->p.offset;
|
||||
|
Reference in New Issue
Block a user