Reported-by: [email protected]
Signed-off-by: Alan Huang <[email protected]>
---
 fs/bcachefs/disk_accounting.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/bcachefs/disk_accounting.c b/fs/bcachefs/disk_accounting.c
index f96530c70262..5944ad6d0f8d 100644
--- a/fs/bcachefs/disk_accounting.c
+++ b/fs/bcachefs/disk_accounting.c
@@ -184,6 +184,9 @@ int bch2_accounting_validate(struct bch_fs *c, struct 
bkey_s_c k,
        void *end = &acc_k + 1;
        int ret = 0;
 
+       if (acc_k.type >= BCH_DISK_ACCOUNTING_TYPE_NR)
+               return 0;
+
        bkey_fsck_err_on((from.flags & BCH_VALIDATE_commit) &&
                         bversion_zero(k.k->bversion),
                         c, accounting_key_version_0,
-- 
2.49.0


Reply via email to