diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:22:53 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-31 12:18:37 -0400 |
commit | 48f866e90f520855b6d941eebe46d75dbfbb9a81 (patch) | |
tree | f9190a76fa80ccc04aa24a247b06ac8c2b2cd6c1 /fs/bcachefs/printbuf.c | |
parent | 9db2f86060a8e54e80f99e3c3366832ce6a67d76 (diff) | |
download | linux-48f866e90f520855b6d941eebe46d75dbfbb9a81.tar.gz linux-48f866e90f520855b6d941eebe46d75dbfbb9a81.tar.bz2 linux-48f866e90f520855b6d941eebe46d75dbfbb9a81.zip |
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>
Diffstat (limited to 'fs/bcachefs/printbuf.c')
-rw-r--r-- | fs/bcachefs/printbuf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bcachefs/printbuf.c b/fs/bcachefs/printbuf.c index de41f9a14492..5e653eb81d54 100644 --- a/fs/bcachefs/printbuf.c +++ b/fs/bcachefs/printbuf.c @@ -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); } } |