#! /bin/bash # SPDX-License-Identifier: GPL-2.0 # Copyright (c) 2013 Red Hat, Inc. All Rights Reserved. # # FS QA Test No. generic/324 # # Sanity check for defrag utility. # seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq" PIDS="" tmp=/tmp/$$ status=1 # failure is the default! trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { rm -f $tmp.* } # get standard environment, filters and checks . ./common/rc . ./common/filter . ./common/defrag # real QA test starts here _supported_os Linux _require_scratch _require_defrag _require_xfs_io_command "falloc" rm -f $seqres.full _workout() { nr=$1 echo "Defragment file with $nr * 2 fragments" # Create sparse file for ((i=0;i> $seqres.full 2>&1 done # Fill holes for half of range , as result file will contain nr*1.5 fragments $XFS_IO_PROG -c "falloc 0 $((204800*nr))" \ $SCRATCH_MNT/test.$nr | _filter_xfs_io # Data wrilte will convert extetns to inialized ones for ((i=0;i> $seqres.full 2>&1 _scratch_mount _workout 10 _workout 250 _workout 1000 status=0