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 seqres=$RESULT_DIR/$seq
15 echo "QA output created by $seq"
19 status=1 # failure is the default!
20 trap "_cleanup; exit \$status" 0 1 2 3 15
27 # get standard environment, filters and checks
32 # real QA test starts here
36 _require_xfs_quota_foreign
41 _qmount_option "grpquota"
42 _scratch_mkfs > $seqres.full
45 dir="$SCRATCH_MNT/dummy"
48 $XFS_QUOTA_PROG -x -c "limit -g bsoft=100k bhard=100k $qa_user" $SCRATCH_MNT
50 $XFS_IO_PROG -f -c 'pwrite -S 0x58 0 1m' $dir/foo >> $seqres.full
51 chown $qa_user "${dir}/foo"
52 _user_do "chgrp $qa_user ${dir}/foo" 2>&1 | _filter_scratch
53 ls -la ${dir} >> $seqres.full
54 $XFS_QUOTA_PROG -x -c 'report -hag' $SCRATCH_MNT >> $seqres.full