Commit 48f866e9 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Fix bch2_prt_bitflags()

This fixes an infinite loop when there's a set bit at position >= 32.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 9db2f860
...@@ -415,11 +415,11 @@ void bch2_prt_bitflags(struct printbuf *out, ...@@ -415,11 +415,11 @@ void bch2_prt_bitflags(struct printbuf *out,
while (list[nr]) while (list[nr])
nr++; nr++;
while (flags && (bit = __ffs(flags)) < nr) { while (flags && (bit = __ffs64(flags)) < nr) {
if (!first) if (!first)
bch2_prt_printf(out, ","); bch2_prt_printf(out, ",");
first = false; first = false;
bch2_prt_printf(out, "%s", list[bit]); bch2_prt_printf(out, "%s", list[bit]);
flags ^= 1 << bit; flags ^= BIT_ULL(bit);
} }
} }
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