summaryrefslogtreecommitdiff
path: root/tests/generic/280
blob: 8e1ae4d298163b874cf701d899f123a5caeb3565 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2012 Red Hat, Inc.  All Rights Reserved.
#
# FS QA Test No. 280
#
# Test quota vs. suspend/freeze deadlock, 
# dcdbed85 quota: Fix deadlock with suspend and quotas
#
. ./common/preamble
_begin_fstest auto quota freeze

# Override the default cleanup function.
_cleanup()
{
	# Make sure $SCRATCH_MNT is unfreezed
	xfs_freeze -u $SCRATCH_MNT 2>/dev/null
	[ -n "$pid" ] && kill -9 $pid 2>/dev/null
	wait $pid
	cd /
	rm -f $tmp.*
}

# Import common functions.
. ./common/filter
. ./common/quota

_require_scratch
_require_quota
_require_freeze

# real QA test starts here

# Modify as appropriate.
_supported_fs generic

_scratch_unmount 2>/dev/null
_scratch_mkfs >> $seqres.full 2>&1
_scratch_mount "-o usrquota,grpquota"
quotacheck -u -g $SCRATCH_MNT 2>/dev/null
quotaon $SCRATCH_MNT 2>/dev/null
xfs_freeze -f $SCRATCH_MNT
setquota -u root 1 2 3 4 $SCRATCH_MNT &
pid=$!
sleep 1
xfs_freeze -u $SCRATCH_MNT
wait $pid
unset pid

# Failure comes in the form of a deadlock.

# success, all done
status=0
exit