fsx/fsstress: round blocksize properly
[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_fs generic
38
39 rm -f $seqres.full
40
41 _scratch_unmount 2>/dev/null
42 _scratch_mkfs >> $seqres.full 2>&1
43 _scratch_mount "-o usrquota,grpquota"
44 quotacheck -u -g $SCRATCH_MNT 2>/dev/null
45 quotaon $SCRATCH_MNT 2>/dev/null
46 xfs_freeze -f $SCRATCH_MNT
47 setquota -u root 1 2 3 4 $SCRATCH_MNT &
48 pid=$!
49 sleep 1
50 xfs_freeze -u $SCRATCH_MNT
51 wait $pid
52 _scratch_unmount
53
54 # Failure comes in the form of a deadlock.
55
56 # success, all done
57 status=0
58 exit