b84cfc85af5e7ef1cbc0af08c2cd5d160dc20f30
[xfstests-dev.git] / tests / generic / 323
1 #! /bin/bash
2 # FS QA Test No. 323
3 #
4 # Run aio-last-ref-held-by-io - last put of ioctx not in process
5 # context. We've had a couple of instances in the past where having the
6 # last reference to an ioctx be held by the IO (instead of the
7 # process) would cause problems (hung system, crashes).
8
9 #-----------------------------------------------------------------------
10 # Copyright (c) 2014 Red Hat, Inc.  All Rights Reserved.
11 #
12 # This program is free software; you can redistribute it and/or
13 # modify it under the terms of the GNU General Public License as
14 # published by the Free Software Foundation.
15 #
16 # This program is distributed in the hope that it would be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 # GNU General Public License for more details.
20 #
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write the Free Software Foundation,
23 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
24 #-----------------------------------------------------------------------
25 #
26
27 seq=`basename $0`
28 seqres=$RESULT_DIR/$seq
29 echo "QA output created by $seq"
30
31 here=`pwd`
32 tmp=/tmp/$$
33 status=1        # failure is the default!
34 trap "_cleanup; exit \$status" 0 1 2 3 15
35
36 _cleanup()
37 {
38         cd /
39         rm -f $tmp.*
40 }
41
42 # get standard environment, filters and checks
43 . ./common/rc
44 . ./common/filter
45
46 # real QA test starts here
47
48 _supported_fs generic
49 _supported_os Linux
50
51 _require_aiodio aio-last-ref-held-by-io
52
53 testfile=$TEST_DIR/aio-testfile
54 $XFS_IO_PROG -ftc "pwrite 0 10m" $testfile | _filter_xfs_io
55
56 $AIO_TEST 0 100 $testfile
57 if [ $? -ne 0 ]; then
58         exit $status
59 fi
60
61 $AIO_TEST 1 100 $testfile
62 if [ $? -ne 0 ]; then
63         exit $status
64 fi
65
66 status=0
67 exit $status