projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9db2f86
)
bcachefs: Fix bch2_prt_bitflags()
author
Kent Overstreet
<kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:22:53 +0000
(17:22 -0400)
committer
Kent Overstreet
<kent.overstreet@linux.dev>
Tue, 31 Oct 2023 16:18:37 +0000
(12:18 -0400)
This fixes an infinite loop when there's a set bit at position >= 32.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/printbuf.c
patch
|
blob
|
history
diff --git
a/fs/bcachefs/printbuf.c
b/fs/bcachefs/printbuf.c
index de41f9a144920b83fb816182a4c97fecc1df87bf..5e653eb81d54f8fdfcca37038eeaf5a1febdb8e7 100644
(file)
--- 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 = __ffs
64
(flags)) < nr) {
if (!first)
bch2_prt_printf(out, ",");
first = false;
bch2_prt_printf(out, "%s", list[bit]);
- flags ^=
1 << bit
;
+ flags ^=
BIT_ULL(bit)
;
}
}