generic: add _require_odirect to generic/113 and generic/214
[xfstests-dev.git] / tests / generic / 102
1 #! /bin/bash
2 # FS QA Test No. 102
3 #
4 # TEST busy loop of write and delete in a filesystem.
5 # Sometimes writes will failed on NO_SPACE when disk almost full
6 # in btrfs. It is long-term problem since very beginning for btrfs
7 #
8 # This issue was fixed by the patchset named:
9 #
10 # btrfs: Fix no_space on dd and rm loop < from zhaolei@cn.fujitsu.com >
11 #
12 #-----------------------------------------------------------------------
13 # Copyright (c) 2015 Fujitsu.  All Rights Reserved.
14 # Author: Wang Yanfeng <wangyf-fnst@cn.fujitsu.com>
15 #
16 # This program is free software; you can redistribute it and/or
17 # modify it under the terms of the GNU General Public License as
18 # published by the Free Software Foundation.
19 #
20 # This program is distributed in the hope that it would be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23 # GNU General Public License for more details.
24 #
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write the Free Software Foundation,
27 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
28 #-----------------------------------------------------------------------
29 #
30
31 seq=`basename $0`
32 seqres=$RESULT_DIR/$seq
33 echo "QA output created by $seq"
34
35 tmp=/tmp/$$
36 status=1
37 trap "exit \$status" 0 1 2 3 15
38
39 # get standard environment, filters and checks
40 . ./common/rc
41 . ./common/filter
42
43 # real QA test starts here
44 _need_to_be_root
45 _supported_fs generic
46 _supported_os Linux
47 _require_scratch
48
49 rm -f $seqres.full
50
51 dev_size=$((512 * 1024 * 1024))     # 512MB filesystem
52 _scratch_mkfs_sized $dev_size >>$seqres.full 2>&1
53 _scratch_mount
54
55 for ((i = 0; i < 10; i++)); do
56         echo "loop $i" >>$seqres.full
57
58         $XFS_IO_PROG -f -c "pwrite -b 1m 0 400m" "$SCRATCH_MNT"/file | \
59 _filter_xfs_io | _filter_scratch
60
61         rm -f "$SCRATCH_MNT"/file
62 done
63
64 status=0
65 exit