bcachefs: Fix bch2_prt_bitflags()

This fixes an infinite loop when there's a set bit at position >= 32.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2023-10-22 17:22:53 -04:00
parent 9db2f86060
commit 48f866e90f

View File

@ -415,11 +415,11 @@ void bch2_prt_bitflags(struct printbuf *out,
while (list[nr])
nr++;
while (flags && (bit = __ffs(flags)) < nr) {
while (flags && (bit = __ffs64(flags)) < nr) {
if (!first)
bch2_prt_printf(out, ",");
first = false;
bch2_prt_printf(out, "%s", list[bit]);
flags ^= 1 << bit;
flags ^= BIT_ULL(bit);
}
}