generic: test deadlock on O_DIRECT|O_DSYNC
[xfstests-dev.git] / tests / generic / 280
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2012 Red Hat, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 280
6 #
7 # Test quota vs. suspend/freeze deadlock, 
8 # dcdbed85 quota: Fix deadlock with suspend and quotas
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 $tmp.*
23 }
24
25 # get standard environment, filters and checks
26 . ./common/rc
27 . ./common/filter
28 . ./common/quota
29
30 _require_scratch
31 _require_quota
32 _require_freeze
33
34 # real QA test starts here
35
36 # Modify as appropriate.
37 _supported_os Linux
38 _supported_fs generic
39
40 rm -f $seqres.full
41
42 _scratch_unmount 2>/dev/null
43 _scratch_mkfs >> $seqres.full 2>&1
44 _scratch_mount "-o usrquota,grpquota"
45 quotacheck -u -g $SCRATCH_MNT 2>/dev/null
46 quotaon $SCRATCH_MNT 2>/dev/null
47 xfs_freeze -f $SCRATCH_MNT
48 setquota -u root 1 2 3 4 $SCRATCH_MNT &
49 pid=$!
50 sleep 1
51 xfs_freeze -u $SCRATCH_MNT
52 wait $pid
53 _scratch_unmount
54
55 # Failure comes in the form of a deadlock.
56
57 # success, all done
58 status=0
59 exit