]> www.infradead.org Git - users/hch/block.git/commitdiff
bcachefs: Convert disk accounting BUG_ON() to WARN_ON()
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 28 Sep 2024 01:05:59 +0000 (21:05 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 28 Sep 2024 02:32:22 +0000 (22:32 -0400)
We had a bug where disk accounting keys didn't always have their version
field set in journal replay; change the BUG_ON() to a WARN(), and
exclude this case since it's now checked for elsewhere (in the bkey
validate function).

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/disk_accounting.c

index 59897b347c62ac3e528d34d7f9efec96b7b29f02..9f3133e3e7e5e4deca5c45cc090f4792a5e2671e 100644 (file)
@@ -648,7 +648,7 @@ int bch2_accounting_read(struct bch_fs *c)
                        if (i + 1 < &darray_top(*keys) &&
                            i[1].k->k.type == KEY_TYPE_accounting &&
                            !journal_key_cmp(i, i + 1)) {
-                               BUG_ON(bversion_cmp(i[0].k->k.bversion, i[1].k->k.bversion) >= 0);
+                               WARN_ON(bversion_cmp(i[0].k->k.bversion, i[1].k->k.bversion) >= 0);
 
                                i[1].journal_seq = i[0].journal_seq;