From 071c4a6311a1ff53ec6097ebca4561d1880271c3 Mon Sep 17 00:00:00 2001 From: Gianfranco Trad Date: Wed, 23 Oct 2024 22:42:56 +0200 Subject: [PATCH] bcachefs: Fix invalid shift in validate_sb_layout() Signed-off-by: Gianfranco Trad --- fs/bcachefs/super-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/bcachefs/super-io.c b/fs/bcachefs/super-io.c index ce7410d72089..428172897501 100644 --- a/fs/bcachefs/super-io.c +++ b/fs/bcachefs/super-io.c @@ -287,7 +287,7 @@ static int validate_sb_layout(struct bch_sb_layout *layout, struct printbuf *out return -BCH_ERR_invalid_sb_layout_nr_superblocks; } - max_sectors = 1 << layout->sb_max_size_bits; + max_sectors = 1 << min(BCH_SB_LAYOUT_SIZE_BITS_MAX, layout->sb_max_size_bits); prev_offset = le64_to_cpu(layout->sb_offset[0]); -- 2.43.0