generic/223: make sure all files get created on the data device
[xfstests-dev.git] / tests / generic / 566
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0+
3 # Copyright (c) 2019, Oracle and/or its affiliates.  All Rights Reserved.
4 #
5 # FS QA Test No. 566
6 #
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.
9 #
10 # This test goes with commit 1fb254aa983bf ("xfs: fix missing ILOCK unlock when
11 # xfs_setattr_nonsize fails due to EDQUOT")
12
13 seq=`basename $0`
14 seqres=$RESULT_DIR/$seq
15 echo "QA output created by $seq"
16
17 here=`pwd`
18 tmp=/tmp/$$
19 status=1    # failure is the default!
20 trap "_cleanup; exit \$status" 0 1 2 3 15
21
22 _cleanup()
23 {
24         cd /
25 }
26
27 # get standard environment, filters and checks
28 . ./common/rc
29 . ./common/quota
30 . ./common/filter
31
32 # real QA test starts here
33 _supported_fs generic
34 _require_scratch
35 _require_quota
36 _require_xfs_quota_foreign
37 _require_user
38
39 rm -f $seqres.full
40
41 _qmount_option "grpquota"
42 _scratch_mkfs > $seqres.full
43 _qmount
44
45 dir="$SCRATCH_MNT/dummy"
46 mkdir -p $dir
47 chown $qa_user $dir
48 $XFS_QUOTA_PROG -x -c "limit -g bsoft=100k bhard=100k $qa_user" $SCRATCH_MNT
49
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
55
56 # success, all done
57 status=0
58 exit