2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2011 Red Hat, Inc. All Rights Reserved.
7 # Bmap btree corruption regression test
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
21 umount $LOOP_MNT 2>/dev/null
26 # get standard environment, filters and checks
30 # real QA test starts here
36 LOOP_DEV=$TEST_DIR/$seq.fs
37 LOOP_MNT=$TEST_DIR/$seq.mnt
44 # real QA test starts here
46 echo "*** create loop mount point"
47 rmdir $LOOP_MNT 2>/dev/null
48 mkdir -p $LOOP_MNT || _fail "cannot create loopback mount point"
56 dparam="file,name=$LOOP_DEV,size=$size"
57 if [ -n "$agsize" ]; then
58 dparam="$dparam,agsize=$agsize"
61 echo "*** mkfs loop file (size=$size)"
62 $MKFS_XFS_PROG -d $dparam \
63 | _filter_mkfs 2>/dev/null
65 echo "*** mount loop filesystem"
66 mount -t xfs -o loop $LOOP_DEV $LOOP_MNT
68 echo "*** preallocate large file"
69 $XFS_IO_PROG -f -c "resvsp 0 $fsize" $LOOP_MNT/foo | _filter_io
71 echo "*** unmount loop filesystem"
72 umount $LOOP_MNT > /dev/null 2>&1
74 echo "*** check loop filesystem"
75 _check_xfs_filesystem $LOOP_DEV none none
78 _test_loop 50g 16m 40G