#
seq=`basename $0`
+seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
status=1 # failure is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15
-. common.config
-. common.rc
+. ./common/rc
_supported_fs ext4 xfs
_supported_os Linux
+_require_loop
_require_fstrim
+_require_xfs_io_command "fiemap"
_require_fs_space $TEST_DIR 307200
[ "$FSTYP" = "ext4" ] && _require_dumpe2fs
get_holes()
{
- $XFS_IO_PROG -c fiemap $1 | grep hole | $SED_PROG 's/.*\[\(.*\)\.\.\(.*\)\].*/\1 \2/'
+ $XFS_IO_PROG -F -c fiemap $1 | grep hole | $SED_PROG 's/.*\[\(.*\)\.\.\(.*\)\].*/\1 \2/'
}
get_free_sectors()
agsize=`xfs_info $loop_mnt | $SED_PROG -n 's/.*agsize=\(.*\) blks.*/\1/p'`
# Convert free space (agno, block, length) to (start sector, end sector)
$UMOUNT_PROG $loop_mnt
- $XFS_DB_PROG -c "freesp -d" $img_file | $SED_PROG '/^.*from/,$d'| \
+ $XFS_DB_PROG -r -c "freesp -d" $img_file | $SED_PROG '/^.*from/,$d'| \
$AWK_PROG -v spb=$sectors_per_block -v agsize=$agsize \
'{ print spb * ($1 * agsize + $2), spb * ($1 * agsize + $2 + $3) - 1 }'
;;
$MOUNT_PROG $loop_dev $loop_mnt
echo -n "Generating garbage on loop..."
+# Goal is to fill it up, ignore any errors.
for i in `seq 1 10`; do
- mkdir $loop_mnt/$i
- cp -r $here/* $loop_mnt/$i
+ mkdir $loop_mnt/$i &> /dev/null
+ cp -r $here/* $loop_mnt/$i &> /dev/null || break
done
# Get reference fiemap, this can contain i.e. uninitialized inode table