generic: test MADV_POPULATE_READ with IO errors
[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 . ./common/preamble
14 _begin_fstest auto quick quota metadata
15
16 # Override the default cleanup function.
17 _cleanup()
18 {
19         cd /
20 }
21
22 # Import common functions.
23 . ./common/quota
24 . ./common/filter
25
26 # real QA test starts here
27 _supported_fs generic
28 _require_scratch
29 _require_quota
30 _require_xfs_quota_foreign
31 _require_user
32
33 _qmount_option "grpquota"
34 _scratch_mkfs > $seqres.full
35 _qmount
36
37 dir="$SCRATCH_MNT/dummy"
38 mkdir -p $dir
39 chown $qa_user $dir
40 $XFS_QUOTA_PROG -x -c "limit -g bsoft=100k bhard=100k $qa_user" $SCRATCH_MNT
41
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
47
48 # success, all done
49 status=0
50 exit