diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-22 17:21:35 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-05-08 17:29:20 -0400 |
commit | c4e8db2b5d31fc488c644019b99bf41fd616895f (patch) | |
tree | 148c20b8a49e4382141c55ebf700486f1bc89049 /fs/bcachefs/buckets.c | |
parent | b769590f33dcb04cb8efc4905030f4a41df08e2b (diff) |
bcachefs: bucket_data_type_mismatch()
We're working on potentially unifying bch2_check_bucket_ref() and
bch2_check_fix_ptrs() - or at least eliminating gratuitious differences.
Most immediately, there's a bunch of cleanups to be done regarding
BCH_DATA_stripe.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/buckets.c')
-rw-r--r-- | fs/bcachefs/buckets.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index 74e2098dfde5..36d13819a27d 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -498,13 +498,6 @@ int bch2_check_bucket_ref(struct btree_trans *trans, struct printbuf buf = PRINTBUF; int ret = 0; - if (bucket_data_type == BCH_DATA_cached) - bucket_data_type = BCH_DATA_user; - - if ((bucket_data_type == BCH_DATA_stripe && ptr_data_type == BCH_DATA_user) || - (bucket_data_type == BCH_DATA_user && ptr_data_type == BCH_DATA_stripe)) - bucket_data_type = ptr_data_type = BCH_DATA_stripe; - if (gen_after(ptr->gen, b_gen)) { bch2_fsck_err(c, FSCK_CAN_IGNORE|FSCK_NEED_FSCK, BCH_FSCK_ERR_ptr_gen_newer_than_bucket_gen, @@ -552,9 +545,7 @@ int bch2_check_bucket_ref(struct btree_trans *trans, goto out; } - if (!data_type_is_empty(bucket_data_type) && - ptr_data_type && - bucket_data_type != ptr_data_type) { + if (bucket_data_type_mismatch(bucket_data_type, ptr_data_type)) { bch2_fsck_err(c, FSCK_CAN_IGNORE|FSCK_NEED_FSCK, BCH_FSCK_ERR_ptr_bucket_data_type_mismatch, "bucket %u:%zu gen %u different types of data in same bucket: %s, %s\n" |