]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bcachefs: Fix bch2_trigger_alloc assert
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 19 Aug 2024 00:18:34 +0000 (20:18 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Thu, 22 Aug 2024 06:07:22 +0000 (02:07 -0400)
On testing on an old mangled filesystem, we missed a case.

Fixes: bd864bc2d907 ("bcachefs: Fix bch2_trigger_alloc when upgrading from old versions")
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/alloc_background.c

index fd3a2522bc3ed3eb56303a95681807a929cf7c3b..488d0710f7b997ee2f9315ecba49e1f10d2ba1e4 100644 (file)
@@ -829,7 +829,7 @@ int bch2_trigger_alloc(struct btree_trans *trans,
        if (likely(new.k->type == KEY_TYPE_alloc_v4)) {
                new_a = bkey_s_to_alloc_v4(new).v;
        } else {
-               BUG_ON(!(flags & BTREE_TRIGGER_gc));
+               BUG_ON(!(flags & (BTREE_TRIGGER_gc|BTREE_TRIGGER_check_repair)));
 
                struct bkey_i_alloc_v4 *new_ka = bch2_alloc_to_v4_mut_inlined(trans, new.s_c);
                ret = PTR_ERR_OR_ZERO(new_ka);