Whamcloud - gitweb
Fix UBSAN if s_log_groups_per_flex is 31
authorTheodore Ts'o <tytso@mit.edu>
Sun, 7 Aug 2022 23:47:25 +0000 (19:47 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 7 Aug 2022 23:49:33 +0000 (19:49 -0400)
commit5cfdceb4909d9ee6ac2502b83215fb71f5077e06
tree8da558bd1d2e42e3338f81ac000bab9ca9dee5f2
parent80e1504f2ce33c9ebc5045009c7bcde9315526c0
Fix UBSAN if s_log_groups_per_flex is 31

It is logal (albeit rare) for the number of block groups per flex_bg
to 2**31 (which effectively means to put all of the block groups into
a single flex_bg).  However, in that case "1 << 31" is undefined on
architectures with a 32-bit integer.  Fix this UBSAN complaint by
using "1U << 31" instead.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/pass1.c
lib/e2p/ls.c
lib/ext2fs/alloc_tables.c
lib/ext2fs/mkjournal.c
lib/ext2fs/rw_bitmaps.c
misc/e4defrag.c
resize/main.c
resize/resize2fs.c