generic/233,270: unlimit the max locked memory size for io_uring
[xfstests-dev.git] / tests / xfs / 007
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2014 Red Hat, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. xfs/007
6 #
7 # Test to verify Q_XQUOTARM functionality.
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=1        # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
17
18 _cleanup()
19 {
20     cd /
21     rm -f $tmp.*
22 }
23
24 # get standard environment, filters and checks
25 . ./common/rc
26 . ./common/filter
27 . ./common/quota
28
29 # Modify as appropriate.
30 _supported_fs xfs
31
32 _require_scratch
33 _require_xfs_quota
34
35 rm -f $seqres.full
36
37 _scratch_mkfs_xfs | _filter_mkfs > /dev/null 2> $tmp.mkfs
38 . $tmp.mkfs
39
40 do_test()
41 {
42         qino_1=$1
43         qino_2=$2
44         off_opts=$3
45
46         echo "*** umount"
47         _scratch_unmount
48
49         QINO_1=`_scratch_xfs_get_sb_field $qino_1`
50         QINO_2=`_scratch_xfs_get_sb_field $qino_2`
51
52         echo "*** Usage before quotarm ***"
53         _scratch_xfs_db -c "inode $QINO_1" -c "p core.nblocks"
54         _scratch_xfs_db -c "inode $QINO_2" -c "p core.nblocks"
55
56         _qmount
57         echo "*** turn off $off_opts quotas"
58         xfs_quota -x -c "off -$off_opts" $SCRATCH_MNT
59         xfs_quota -x -c "remove -$off_opts" $SCRATCH_MNT
60         echo "*** umount"
61         _scratch_unmount
62
63         echo "*** Usage after quotarm ***"
64         _scratch_xfs_db -c "inode $QINO_1" -c "p core.nblocks"
65         _scratch_xfs_db -c "inode $QINO_2" -c "p core.nblocks"
66 }
67
68
69 # Test user and group first
70 _qmount_option "uquota,gquota"
71 _qmount
72 do_test uquotino gquotino ug
73
74 # Test user and project. Note that pquotino only exists on v5 (crc=1)
75 # superblocks. Older supers reuse gquotino.
76 PQUOTINO=pquotino
77 if [ $_fs_has_crcs == 0 ]; then
78         PQUOTINO=gquotino
79 fi
80 _qmount_option "uquota,pquota"
81 _qmount
82 _require_prjquota $SCRATCH_DEV
83 do_test uquotino $PQUOTINO up
84
85 # success, all done
86 status=0
87 exit