diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-19 19:03:58 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-05-08 17:29:20 -0400 |
commit | 70e3e039cf65f67fa3c41b51cb00a58f6cd48886 (patch) | |
tree | ceb664bcda1e3abf653a0e2f489aa6c04a3e4f9b /fs/bcachefs/ec.c | |
parent | 9cc455d1bcd3bd44d1f103bf3f2e58293976a006 (diff) | |
download | lwn-70e3e039cf65f67fa3c41b51cb00a58f6cd48886.tar.gz lwn-70e3e039cf65f67fa3c41b51cb00a58f6cd48886.zip |
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>
Diffstat (limited to 'fs/bcachefs/ec.c')
-rw-r--r-- | fs/bcachefs/ec.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/bcachefs/ec.c b/fs/bcachefs/ec.c index 2d1b20856841..31db3c8fce50 100644 --- a/fs/bcachefs/ec.c +++ b/fs/bcachefs/ec.c @@ -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; |