btrfs/012: check free size of scratch device before copying files
[xfstests-dev.git] / tests / generic / 239
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2010 Red Hat, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 239
6 #
7 # Read from a sparse file immedialy after filling a hole to test for races
8 # in unwritten extent conversion.
9 #
10 seq=`basename $0`
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
13
14 here=`pwd`
15 tmp=/tmp/$$
16 status=1        # failure is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 15
18
19 _cleanup()
20 {
21     cd /
22     rm -f $TEST_DIR/tst-aio-dio-sparse-unwritten
23 }
24
25 # get standard environment, filters and checks
26 . ./common/rc
27 . ./common/filter
28
29 _supported_fs generic
30
31 _require_test
32 _require_sparse_files
33 _require_aiodio aio-dio-hole-filling-race
34
35 echo "Silence is golden"
36
37 for i in `seq 1 500`; do
38   $AIO_TEST $TEST_DIR/tst-aio-dio-hole-filling-race || break
39 done
40
41 status=$?
42 exit