_scratch_mkfs_geom(): Filter out 'k' suffix from fs block size
authorChandan Babu R <chandanrlinux@gmail.com>
Tue, 9 Feb 2021 16:12:52 +0000 (21:42 +0530)
committerEryu Guan <guaneryu@gmail.com>
Sun, 28 Feb 2021 13:02:22 +0000 (21:02 +0800)
commitb13284d992aad356705f7616bd8e2d1e27a75294
treefc7b04dc870fd6fa2e8f1789146a278d21acedb3
parent08a617f21dca5acd0c0dbd54c5e4ea78de912395
_scratch_mkfs_geom(): Filter out 'k' suffix from fs block size

If the original value of $MKFS_OPTIONS contained a block size value
having 'k' as a suffix (e.g. -b size=4k), then the newly constructed
value of $MKFS_OPTIONS will have 'k' suffixed to the value of
$blocksize.  $blocksize itself is specified in units of bytes. Hence
having 'k' suffixed to this value will result in an incorrect block
size.

This commit fixes the bug by conditionally filtering out the 'k'
suffix from block size option present in the original value of
$MKFS_OPTIONS.

Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/rc