Commit e150a7e8 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Fix bch2_trigger_alloc assert

On testing on an old mangled filesystem, we missed a case.

Fixes: bd864bc2 ("bcachefs: Fix bch2_trigger_alloc when upgrading from old versions")
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 49203a6b
...@@ -829,7 +829,7 @@ int bch2_trigger_alloc(struct btree_trans *trans, ...@@ -829,7 +829,7 @@ int bch2_trigger_alloc(struct btree_trans *trans,
if (likely(new.k->type == KEY_TYPE_alloc_v4)) { if (likely(new.k->type == KEY_TYPE_alloc_v4)) {
new_a = bkey_s_to_alloc_v4(new).v; new_a = bkey_s_to_alloc_v4(new).v;
} else { } 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); struct bkey_i_alloc_v4 *new_ka = bch2_alloc_to_v4_mut_inlined(trans, new.s_c);
ret = PTR_ERR_OR_ZERO(new_ka); ret = PTR_ERR_OR_ZERO(new_ka);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment