2 # SPDX-License-Identifier: GPL-2.0+
3 # Copyright (c) 2019, Oracle and/or its affiliates. All Rights Reserved.
7 # Regression test for chgrp returning to userspace with ILOCK held after a hard
8 # quota error. This causes the filesystem to hang if kernel is not patched.
10 # This test goes with commit 1fb254aa983bf ("xfs: fix missing ILOCK unlock when
11 # xfs_setattr_nonsize fails due to EDQUOT")
14 _begin_fstest auto quick quota metadata
16 # Override the default cleanup function.
22 # Import common functions.
26 # real QA test starts here
30 _require_xfs_quota_foreign
33 _qmount_option "grpquota"
34 _scratch_mkfs > $seqres.full
37 dir="$SCRATCH_MNT/dummy"
40 $XFS_QUOTA_PROG -x -c "limit -g bsoft=100k bhard=100k $qa_user" $SCRATCH_MNT
42 $XFS_IO_PROG -f -c 'pwrite -S 0x58 0 1m' $dir/foo >> $seqres.full
43 chown $qa_user "${dir}/foo"
44 _user_do "chgrp $qa_user ${dir}/foo" 2>&1 | _filter_scratch
45 ls -la ${dir} >> $seqres.full
46 $XFS_QUOTA_PROG -x -c 'report -hag' $SCRATCH_MNT >> $seqres.full