2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2014 Red Hat, Inc. All Rights Reserved.
5 # FS QA Test No. xfs/007
7 # Test to verify Q_XQUOTARM functionality.
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
24 # get standard environment, filters and checks
29 # Modify as appropriate.
38 _scratch_mkfs_xfs | _filter_mkfs > /dev/null 2> $tmp.mkfs
50 QINO_1=`_scratch_xfs_get_sb_field $qino_1`
51 QINO_2=`_scratch_xfs_get_sb_field $qino_2`
53 echo "*** Usage before quotarm ***"
54 _scratch_xfs_db -c "inode $QINO_1" -c "p core.nblocks"
55 _scratch_xfs_db -c "inode $QINO_2" -c "p core.nblocks"
58 echo "*** turn off $off_opts quotas"
59 xfs_quota -x -c "off -$off_opts" $SCRATCH_MNT
60 xfs_quota -x -c "remove -$off_opts" $SCRATCH_MNT
64 echo "*** Usage after quotarm ***"
65 _scratch_xfs_db -c "inode $QINO_1" -c "p core.nblocks"
66 _scratch_xfs_db -c "inode $QINO_2" -c "p core.nblocks"
70 # Test user and group first
71 _qmount_option "uquota,gquota"
73 do_test uquotino gquotino ug
75 # Test user and project. Note that pquotino only exists on v5 (crc=1)
76 # superblocks. Older supers reuse gquotino.
78 if [ $_fs_has_crcs == 0 ]; then
81 _qmount_option "uquota,pquota"
83 _require_prjquota $SCRATCH_DEV
84 do_test uquotino $PQUOTINO up