Whamcloud - gitweb
LU-12204 mke2fs: fix check for absurdly large devices 62/34762/4 v1.44.5.wc1-lustre
authorAndreas Dilger <adilger@dilger.ca>
Thu, 25 Apr 2019 21:42:58 +0000 (23:42 +0200)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 7 Jun 2019 00:19:49 +0000 (00:19 +0000)
commitdec51e82bc03b0eb5619c99863ae5d914b814ea7
treed6ea2b397519f897f5268a2013e5a3366909ffb2
parent045ec3ce0f16d35f2ee90f9c3adba3471dbfd625
LU-12204 mke2fs: fix check for absurdly large devices

The check in mke2fs is intended to be for the number of blocks in the
filesystem exceeding the maximum number of addressable blocks in 2^32
bitmaps, which is (2^32 * 8 bits/byte * blocksize) = 2^47 blocks,
or 2^59 bytes = 512PiB for the common 4KiB blocksize.

However, s_log_blocksize holds log2(blocksize_in_kb), so the current
calculation is a factor of 2^10 too small.  This caused mke2fs to fail
while trying to format a 900TB filesystem.

Fixes: 101ef2e93c25 ("mke2fs: Avoid crashes / infinite loops for absurdly large devices")
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Change-Id: If6881e19c28d0c98848b9b4ede65b11d81dcab07
Reviewed-on: https://review.whamcloud.com/34762
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
Tested-by: Andreas Dilger <adilger@whamcloud.com>
misc/mke2fs.c