generic: convert tests to SPDX license tags
[xfstests-dev.git] / tests / generic / 102
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2015 Fujitsu.  All Rights Reserved.
4 #
5 # FS QA Test No. 102
6 #
7 # TEST busy loop of write and delete in a filesystem.
8 # Sometimes writes will failed on NO_SPACE when disk almost full
9 # in btrfs. It is long-term problem since very beginning for btrfs
10 #
11 # This issue was fixed by the patchset named:
12 #
13 # btrfs: Fix no_space on dd and rm loop < from zhaolei@cn.fujitsu.com >
14 #
15 seq=`basename $0`
16 seqres=$RESULT_DIR/$seq
17 echo "QA output created by $seq"
18
19 tmp=/tmp/$$
20 status=1
21 trap "exit \$status" 0 1 2 3 15
22
23 # get standard environment, filters and checks
24 . ./common/rc
25 . ./common/filter
26
27 # real QA test starts here
28 _supported_fs generic
29 _supported_os Linux
30 _require_scratch
31
32 rm -f $seqres.full
33
34 dev_size=$((512 * 1024 * 1024))     # 512MB filesystem
35 _scratch_mkfs_sized $dev_size >>$seqres.full 2>&1
36 _scratch_mount
37
38 for ((i = 0; i < 10; i++)); do
39         echo "loop $i" >>$seqres.full
40
41         $XFS_IO_PROG -f -c "pwrite -b 1m 0 400m" "$SCRATCH_MNT"/file | \
42 _filter_xfs_io | _filter_scratch
43
44         rm -f "$SCRATCH_MNT"/file
45 done
46
47 status=0
48 exit