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
35 _require_xfs_io_command "falloc"
37 LOOP_DEV=$TEST_DIR/$seq.fs
38 LOOP_MNT=$TEST_DIR/$seq.mnt
45 # real QA test starts here
47 echo "*** create loop mount point"
48 rmdir $LOOP_MNT 2>/dev/null
49 mkdir -p $LOOP_MNT || _fail "cannot create loopback mount point"
57 dparam="file,name=$LOOP_DEV,size=$size"
58 if [ -n "$agsize" ]; then
59 dparam="$dparam,agsize=$agsize"
62 echo "*** mkfs loop file (size=$size)"
63 $MKFS_XFS_PROG -d $dparam \
64 | _filter_mkfs 2>/dev/null
66 echo "*** mount loop filesystem"
67 mount -t xfs -o loop $LOOP_DEV $LOOP_MNT
69 echo "*** preallocate large file"
70 $XFS_IO_PROG -f -c "resvsp 0 $fsize" $LOOP_MNT/foo | _filter_io
72 echo "*** unmount loop filesystem"
73 umount $LOOP_MNT > /dev/null 2>&1
75 echo "*** check loop filesystem"
76 _check_xfs_filesystem $LOOP_DEV none none
79 _test_loop 50g 16m 40G