summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-11-25 17:03:13 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2024-12-21 01:36:20 -0500
commit686d2ebec683903fe9ca41fd3cef9b4fb924aae4 (patch)
tree0f7e1c21d0e13b03a413e309b1726cd04f9baa04
parentdba8243f3b466dd39ef05ff63890d5acab30c852 (diff)
downloadlinux-686d2ebec683903fe9ca41fd3cef9b4fb924aae4.tar.gz
linux-686d2ebec683903fe9ca41fd3cef9b4fb924aae4.zip
bcachefs: Change "disk accounting version 0" check to commit only
6.11 had a bug where we'd sometimes create disk accounting keys with version 0, which causes issues for journal replay - but we don't need to delete existing accounting keys with version 0. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r--fs/bcachefs/disk_accounting.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/disk_accounting.c b/fs/bcachefs/disk_accounting.c
index bb5dbbf71d04..c5e61265b709 100644
--- a/fs/bcachefs/disk_accounting.c
+++ b/fs/bcachefs/disk_accounting.c
@@ -134,7 +134,8 @@ int bch2_accounting_validate(struct bch_fs *c, struct bkey_s_c k,
void *end = &acc_k + 1;
int ret = 0;
- bkey_fsck_err_on(bversion_zero(k.k->bversion),
+ bkey_fsck_err_on((flags & BCH_VALIDATE_commit) &&
+ bversion_zero(k.k->bversion),
c, accounting_key_version_0,
"accounting key with version=0");