2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2014 Fujitsu. All Rights Reserved.
5 # FS QA Test No. btrfs/033
7 # Regression test for iterating backrefs
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
22 trap "_cleanup ; exit \$status" 0 1 2 3 15
24 # get standard environment, filters and checks
28 # remove previous $seqres.full before test
31 # real QA test starts here
35 _scratch_mkfs > /dev/null 2>&1
38 touch $SCRATCH_MNT/foo
40 # get file with fragments by using backwards writes.
41 for i in `seq 10240 -1 1`; do
42 $XFS_IO_PROG -f -d -c "pwrite $(($i * 4096)) 4096" \
43 $SCRATCH_MNT/foo > /dev/null
46 # get some snapshots here to make sure we are really
47 # suffering from walking backrefs.
48 for i in `seq 0 50`; do
49 $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT \
50 $SCRATCH_MNT/snap_$i >> $seqres.full 2>&1
53 $BTRFS_UTIL_PROG send -f $SCRATCH_MNT/send_file \
54 $SCRATCH_MNT/snap_1 >> $seqres.full 2>&1
56 echo "Silence is golden"