Reported-by: [email protected]
Signed-off-by: Kent Overstreet <[email protected]>
---
 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


Reply via email to