WIP: add no_invalid_checks flag for FS and trans

Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
This commit is contained in:
Thomas Bertschinger 2024-04-28 21:57:07 -06:00
parent 2b8a0f0caf
commit fbb2233089
2 changed files with 8 additions and 1 deletions

View File

@ -632,7 +632,8 @@ struct bch_dev {
x(error) \
x(topology_error) \
x(errors_fixed) \
x(errors_not_fixed)
x(errors_not_fixed) \
x(no_invalid_checks)
enum bch_fs_flags {
#define x(n) BCH_FS_##n,

View File

@ -129,6 +129,9 @@ int bch2_bkey_val_invalid(struct bch_fs *c, struct bkey_s_c k,
const struct bkey_ops *ops = bch2_bkey_type_ops(k.k->type);
int ret = 0;
if (test_bit(BCH_FS_no_invalid_checks, &c->flags))
return 0;
bkey_fsck_err_on(bkey_val_bytes(k.k) < ops->min_val_size, c, err,
bkey_val_size_too_small,
"bad val size (%zu < %u)",
@ -164,6 +167,9 @@ int __bch2_bkey_invalid(struct bch_fs *c, struct bkey_s_c k,
{
int ret = 0;
if (test_bit(BCH_FS_no_invalid_checks, &c->flags))
return 0;
bkey_fsck_err_on(k.k->u64s < BKEY_U64s, c, err,
bkey_u64s_too_small,
"u64s too small (%u < %zu)", k.k->u64s, BKEY_U64s);