Files
apfstests/tests/generic/347
T
Darrick J. Wong bec4884228 common/dmthin: make this work with external log devices
Provide a mkfs helper to format the dm thin device when external devices
are in use, and fix the dmthin mount helper to support them.  This fixes
regressions in generic/347 and generic/500 when external logs are in
use.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-04-25 13:17:01 +08:00

72 lines
1.2 KiB
Bash
Executable File

#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2015 Red Hat, Inc. All Rights Reserved.
#
# FS QA Test No. generic/347
#
# Test very basic thin device usage, exhaustion, and growth
#
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15
BACKING_SIZE=$((500 * 1024 * 1024 / 512)) # 500M
VIRTUAL_SIZE=$((10 * $BACKING_SIZE)) # 5000M
GROW_SIZE=$((100 * 1024 * 1024 / 512)) # 100M
_cleanup()
{
_dmthin_cleanup
rm -f $tmp.*
}
_setup_thin()
{
_dmthin_init $BACKING_SIZE $VIRTUAL_SIZE
_dmthin_set_queue
_dmthin_mkfs
_dmthin_mount
}
_workout()
{
# Overfill it by a bit
for I in `seq 1 500`; do
$XFS_IO_PROG -f -c "pwrite -W 0 1M" $SCRATCH_MNT/file$I &>/dev/null
done
sync
_dmthin_grow $GROW_SIZE
# Write a little more, but don't fill
for I in `seq 501 510`; do
$XFS_IO_PROG -f -c "pwrite 0 1M" $SCRATCH_MNT/file$I &>/dev/null
done
}
# get standard environment, filters and checks
. ./common/rc
. ./common/dmthin
_supported_fs generic
_require_scratch_nocheck
_require_dm_target thin-pool
_setup_thin
_workout
_dmthin_check_fs
_dmthin_cleanup
echo "=== completed"
status=0
exit