Linux bcachefs list
 help / color / mirror / Atom feed
* [PATCH] bcachefs: Fix invalid shift in member_to_text()
@ 2024-10-12  2:09 Kent Overstreet
  2024-10-12  3:37 ` Hongbo Li
  0 siblings, 1 reply; 3+ messages in thread
From: Kent Overstreet @ 2024-10-12  2:09 UTC (permalink / raw)
  To: linux-bcachefs; +Cc: Kent Overstreet, syzbot+064ce437a1ad63d3f6ef

Reported-by: syzbot+064ce437a1ad63d3f6ef@syzkaller.appspotmail.com
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
---
 fs/bcachefs/sb-members.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/bcachefs/sb-members.c b/fs/bcachefs/sb-members.c
index 02bcde3c1b02..b06ba1d0d037 100644
--- a/fs/bcachefs/sb-members.c
+++ b/fs/bcachefs/sb-members.c
@@ -247,7 +247,10 @@ static void member_to_text(struct printbuf *out,
 	prt_newline(out);
 
 	prt_printf(out, "Btree allocated bitmap blocksize:\t");
-	prt_units_u64(out, 1ULL << m.btree_bitmap_shift);
+	if (m.btree_bitmap_shift < 64)
+		prt_units_u64(out, 1ULL << m.btree_bitmap_shift);
+	else
+		prt_printf(out, "(invalid shift %u)", m.btree_bitmap_shift);
 	prt_newline(out);
 
 	prt_printf(out, "Btree allocated bitmap:\t");
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-12  4:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-12  2:09 [PATCH] bcachefs: Fix invalid shift in member_to_text() Kent Overstreet
2024-10-12  3:37 ` Hongbo Li
2024-10-12  4:25   ` Kent Overstreet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox