summaryrefslogtreecommitdiff
path: root/tests/generic/566
blob: 52b01f6d9ef12b7ad4eec5bb85fcf0a20803cea3 (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
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2019, Oracle and/or its affiliates.  All Rights Reserved.
#
# FS QA Test No. 566
#
# Regression test for chgrp returning to userspace with ILOCK held after a hard
# quota error. This causes the filesystem to hang if kernel is not patched.
#
# This test goes with commit 1fb254aa983bf ("xfs: fix missing ILOCK unlock when
# xfs_setattr_nonsize fails due to EDQUOT")

. ./common/preamble
_begin_fstest auto quick quota metadata

# Override the default cleanup function.
_cleanup()
{
	cd /
}

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

# real QA test starts here
_supported_fs generic
_require_scratch
_require_quota
_require_xfs_quota_foreign
_require_user

_qmount_option "grpquota"
_scratch_mkfs > $seqres.full
_qmount

dir="$SCRATCH_MNT/dummy"
mkdir -p $dir
chown $qa_user $dir
$XFS_QUOTA_PROG -x -c "limit -g bsoft=100k bhard=100k $qa_user" $SCRATCH_MNT

$XFS_IO_PROG -f -c 'pwrite -S 0x58 0 1m' $dir/foo >> $seqres.full
chown $qa_user "${dir}/foo"
_user_do "chgrp $qa_user ${dir}/foo" 2>&1 | _filter_scratch
ls -la ${dir} >> $seqres.full
$XFS_QUOTA_PROG -x -c 'report -hag' $SCRATCH_MNT >> $seqres.full

# success, all done
status=0
exit