2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Red Hat, Inc. All Rights Reserved.
7 # test out high quota ids retrieved by Q_GETNEXTQUOTA
8 # Request for next ID near 2^32 should not wrap to 0
10 # Designed to use the new Q_GETNEXTQUOTA quotactl
13 seqres=$RESULT_DIR/$seq
14 echo "QA output created by $seq"
18 status=1 # failure is the default!
19 trap "_cleanup; exit \$status" 0 1 2 3 15
27 # get standard environment, filters and checks
32 # remove previous $seqres.full before test
35 # real QA test starts here
42 _scratch_mkfs >> $seqres.full 2>&1
44 MOUNT_OPTIONS="-o usrquota,grpquota"
48 echo "Launch all quotas"
50 # We want to create a block of quotas for an id very near
51 # 2^32, then ask for the next quota after it. The returned
52 # ID should not overflow to 0.
54 # Populate with 2^32-4
56 setquota -u $ID $ID $ID $ID $ID $SCRATCH_MNT
57 touch ${SCRATCH_MNT}/${ID}
58 chown ${ID} ${SCRATCH_MNT}/${ID}
60 # remount just for kicks, make sure we get it off disk
64 # Ask for the next quota after $ID; should get nothing back
65 # If kernelspace wraps, we'll get 0 back.
68 echo "Ask for ID after $NEXT expecting nothing"
69 $here/src/test-nextquota -i $NEXT -${TYPE} -d $SCRATCH_DEV