mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
xfstests: check for valid input to _scratch_mkfs_sized
_scratch_mkfs_sized requires an integer number of bytes as input; if it's given something else, catch it and _notrun. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Rich Johnston <rjohnston@sgi.com>
This commit is contained in:
committed by
Rich Johnston
parent
c526364502
commit
969ed71b70
@@ -569,6 +569,15 @@ _scratch_mkfs_sized()
|
||||
fssize=$1
|
||||
blocksize=$2
|
||||
[ -z "$blocksize" ] && blocksize=4096
|
||||
|
||||
re='^[0-9]+$'
|
||||
if ! [[ $fssize =~ $re ]] ; then
|
||||
_notrun "error: _scratch_mkfs_sized: fs size \"$fssize\" not an integer."
|
||||
fi
|
||||
if ! [[ $blocksize =~ $re ]] ; then
|
||||
_notrun "error: _scratch_mkfs_sized: block size \"$blocksize\" not an integer."
|
||||
fi
|
||||
|
||||
blocks=`expr $fssize / $blocksize`
|
||||
|
||||
if [ "$HOSTOS" == "Linux" ]; then
|
||||
|
||||
Reference in New Issue
Block a user