common/rc: add _scratch_{u}mount_idmapped() helpers
[xfstests-dev.git] / tests / generic / 323
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2014 Red Hat, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 323
6 #
7 # Run aio-last-ref-held-by-io - last put of ioctx not in process
8 # context. We've had a couple of instances in the past where having the
9 # last reference to an ioctx be held by the IO (instead of the
10 # process) would cause problems (hung system, crashes).
11
12 seq=`basename $0`
13 seqres=$RESULT_DIR/$seq
14 echo "QA output created by $seq"
15
16 here=`pwd`
17 tmp=/tmp/$$
18 status=1        # failure is the default!
19 trap "_cleanup; exit \$status" 0 1 2 3 15
20
21 _cleanup()
22 {
23         cd /
24         rm -f $tmp.*
25 }
26
27 # get standard environment, filters and checks
28 . ./common/rc
29 . ./common/filter
30
31 # real QA test starts here
32
33 _supported_fs generic
34 _require_test
35
36 _require_aiodio aio-last-ref-held-by-io
37
38 testfile=$TEST_DIR/aio-testfile
39 $XFS_IO_PROG -ftc "pwrite 0 10m" $testfile | _filter_xfs_io
40
41 $AIO_TEST 0 100 $testfile
42 if [ $? -ne 0 ]; then
43         exit $status
44 fi
45
46 $AIO_TEST 1 100 $testfile
47 if [ $? -ne 0 ]; then
48         exit $status
49 fi
50
51 status=0
52 exit $status