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 _begin_fstest auto quota quick
12 # Import common functions.
16 # Modify as appropriate.
22 _scratch_mkfs_xfs | _filter_mkfs > /dev/null 2> $tmp.mkfs
34 QINO_1=`_scratch_xfs_get_sb_field $qino_1`
35 QINO_2=`_scratch_xfs_get_sb_field $qino_2`
37 echo "*** Usage before quotarm ***"
38 _scratch_xfs_db -c "inode $QINO_1" -c "p core.nblocks"
39 _scratch_xfs_db -c "inode $QINO_2" -c "p core.nblocks"
42 echo "*** turn off $off_opts quotas"
43 xfs_quota -x -c "off -$off_opts" $SCRATCH_MNT
47 xfs_quota -x -c "remove -$off_opts" $SCRATCH_MNT
51 echo "*** Usage after quotarm ***"
52 _scratch_xfs_db -c "inode $QINO_1" -c "p core.nblocks"
53 _scratch_xfs_db -c "inode $QINO_2" -c "p core.nblocks"
56 # Test user and group first
57 _qmount_option "uquota,gquota"
59 do_test uquotino gquotino ug
61 # Test user and project. Note that pquotino only exists on v5 (crc=1)
62 # superblocks. Older supers reuse gquotino.
64 if [ $_fs_has_crcs == 0 ]; then
67 _qmount_option "uquota,pquota"
69 _require_prjquota $SCRATCH_DEV
70 do_test uquotino $PQUOTINO up