Whamcloud - gitweb
libext2fs: avoid 32-bit overflow in ext2fs_initialize with a 512M cluster size
authorTheodore Ts'o <tytso@mit.edu>
Tue, 15 Jan 2013 00:29:54 +0000 (19:29 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 15 Jan 2013 19:08:18 +0000 (14:08 -0500)
commitdd4f565d5ac3b1f37100291fb1cd067dd0d55d05
treedb6eef9d4716cb26c7fbf324de396c0d3a6afd6c
parent86a985e74987b08090ecbacf3d02c8d80594c809
libext2fs: avoid 32-bit overflow in ext2fs_initialize with a 512M cluster size

If the user attemps to create a 512MB cluster, we need to adjust the
defaults to avoid a 32-bit overflow of s_blocks_per_group.  Also check
to make sure that the caller of ext2fs_initialize() has not given a
value of s_clusters_per_group that would result in an overflow of
s_blocks_per_group.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
lib/ext2fs/initialize.c