Skip to contentSkip to conversation

bcachefs: Ignore accounting key type larger than BCH_DISK_ACCOUNTING_TYPE_NR

PATCH Applied Alan Huang 2 participants 2 messages Aug 4, 2025

lore
Share & tools
lore

Alan Huang

author
#0 lore raw

PATCH v2 1/1 bcachefs: Ignore accounting key type larger than BCH_DISK_ACCOUNTING_TYPE_NR

---
 fs/bcachefs/disk_accounting.c | 3 +++
 1 file changed, 3 insertions(+)
fs/bcachefs/disk_accounting.c +3 -0
index f96530c70262..5944ad6d0f8d 100644
@@ -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,
Signature · 1 line
2.49.0
#1 lore raw
Quoted 2 lines · Alan Huang

Applied

Quoted 21 lines
---
 fs/bcachefs/disk_accounting.c | 3 +++
 1 file changed, 3 insertions(+)
fs/bcachefs/disk_accounting.c +3 -0
index f96530c70262..5944ad6d0f8d 100644
@@ -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,
Signature · 1 line
2.49.0