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.
37 _scratch_mkfs_xfs | _filter_mkfs > /dev/null 2> $tmp.mkfs
49 QINO_1=`_scratch_xfs_get_sb_field $qino_1`
50 QINO_2=`_scratch_xfs_get_sb_field $qino_2`
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"
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
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"
69 # Test user and group first
70 _qmount_option "uquota,gquota"
72 do_test uquotino gquotino ug
74 # Test user and project. Note that pquotino only exists on v5 (crc=1)
75 # superblocks. Older supers reuse gquotino.
77 if [ $_fs_has_crcs == 0 ]; then
80 _qmount_option "uquota,pquota"
82 _require_prjquota $SCRATCH_DEV
83 do_test uquotino $PQUOTINO up