generic: test deadlock on O_DIRECT|O_DSYNC
[xfstests-dev.git] / tests / generic / 609
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2020 Josef Bacik.  All Rights Reserved.
4 #
5 # FS QA Test 609
6 #
7 # iomap can call generic_write_sync() if we're O_DSYNC, so write a basic test to
8 # exercise O_DSYNC so any unsuspecting file systems will get lockdep warnings if
9 # their locking isn't compatible.
10 #
11 seq=`basename $0`
12 seqres=$RESULT_DIR/$seq
13 echo "QA output created by $seq"
14
15 here=`pwd`
16 tmp=/tmp/$$
17 status=1        # failure is the default!
18 trap "_cleanup; exit \$status" 0 1 2 3 15
19
20 _cleanup()
21 {
22         cd /
23         rm -f $tmp.*
24         rm -rf $TEST_DIR/file
25 }
26
27 # get standard environment, filters and checks
28 . ./common/rc
29 . ./common/filter
30
31 # remove previous $seqres.full before test
32 rm -f $seqres.full
33
34 # Modify as appropriate.
35 _supported_fs generic
36 _supported_os Linux
37 _require_test
38 _require_xfs_io_command "pwrite"
39 _require_odirect
40
41 $XFS_IO_PROG -f -d -s -c "pwrite 0 64k" $TEST_DIR/file | _filter_xfs_io
42
43 status=0
44 exit