Whamcloud - gitweb
e2fsprogs: misc/mke2fs.8.in: Correct valid cluster-size values
authorSrivathsa Dara <srivathsa.d.dara@oracle.com>
Wed, 3 Apr 2024 04:30:37 +0000 (04:30 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 16 Apr 2024 03:55:09 +0000 (23:55 -0400)
commit87cbb381f2e2fb9aab316187a70acca9f6d5061b
tree494bcbc3a30438fb4ddf7c4a325232288e867c49
parent24181bb25e52fdecadbc7e434834e6ece85ff932
e2fsprogs: misc/mke2fs.8.in: Correct valid cluster-size values

According to the mke2fs man page, the supported cluster-size values
for an ext4 filesystem are 2048 to 256M bytes. However, this is not
the case.

When mkfs is run to create a filesystem with following specifications:
* 1k blocksize and cluster-size greater than 32M
* 2k blocksize and cluster-size greater than 64M
* 4k blocksize and cluster-size greater than 128M
mkfs fails with "Invalid argument passed to ext2 library while trying
to create journal" error. In general, when the cluster-size to blocksize
ratio is greater than 32k, mkfs fails with this error.

Went through the code and found out that the function
`ext2fs_new_range()` is the source of this error. This is because when
the cluster-size to blocksize ratio exceeds 32k, the length argument
to the function `ext2fs_new_range()` results in 0. Hence, the error.

This patch corrects the valid cluster-size values.

Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/20240403043037.3992724-1-srivathsa.d.dara@oracle.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/mke2fs.8.in