mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
xfstests: don't remove the two first devices from SCRATCH_DEV_POOL
Since common/config is executed twice, if SCRATCH_DEV_POOL is configured via the environment, the current code removes the first device entry twice which means that you lose the second device for the test. The fix is to not remove anything from SCRATCH_DEV_POOL anymore. That used to be done (I can only guess) to allow to pass the SCRATCH_DEV_POOL as an argument to _scratch_mkfs. Since _scratch_mkfs adds the SCRATCH_DEV, the pool mustn't contain that device anymore. A new function _scratch_pool_mkfs is introduced that does the expected thing. Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de> Reviewed-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Rich Johnston <rjohnston@sgi.com>
This commit is contained in:
committed by
Rich Johnston
parent
385f466a3d
commit
f1dce456c5
@@ -267,7 +267,6 @@ get_next_config() {
|
||||
exit 1
|
||||
fi
|
||||
SCRATCH_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
|
||||
SCRATCH_DEV_POOL=`echo $SCRATCH_DEV_POOL | awk '{ ORS=" "; for (i = 2; i <= NF; i++) print $i}'`
|
||||
fi
|
||||
|
||||
echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
|
||||
|
||||
@@ -550,6 +550,18 @@ _scratch_mkfs()
|
||||
esac
|
||||
}
|
||||
|
||||
_scratch_pool_mkfs()
|
||||
{
|
||||
case $FSTYP in
|
||||
btrfs)
|
||||
$MKFS_BTRFS_PROG $MKFS_OPTIONS $* $SCRATCH_DEV_POOL > /dev/null
|
||||
;;
|
||||
*)
|
||||
echo "_scratch_pool_mkfs is not implemented for $FSTYP" 1>&2
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Create fs of certain size on scratch device
|
||||
# _scratch_mkfs_sized <size in bytes> [optional blocksize]
|
||||
_scratch_mkfs_sized()
|
||||
|
||||
Reference in New Issue
Block a user