From: fsgqa Date: Tue, 4 Jun 2002 06:52:25 +0000 (+0000) Subject: allow for non-64K allocations on the xfs IO path, which can cause quota X-Git-Tag: v1.1.0~1091 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=96ed85f4b4b4d17f839189d4735c2330cc0d4248;p=users%2Fhch%2Fxfstests-dev.git allow for non-64K allocations on the xfs IO path, which can cause quota calcs to come out differently (closer to the block limit for example). also helps the multiple blocksize situation too for this test. --- diff --git a/050 b/050 index e16b77785..261c740cd 100755 --- a/050 +++ b/050 @@ -68,10 +68,31 @@ chmod a+rwx $seq.full # arbitrary users will write here _require_scratch _require_quota -# setup a default run -if [ -z "$MOUNT_OPTIONS" ]; then - MOUNT_OPTIONS="-o usrquota"; export MOUNT_OPTIONS -fi +blksoft=100 +blkhard=500 +inosoft=4 +inohard=10 + +# The actual point at which limit enforcement takes place for the +# hard block limit is variable depending on filesystem blocksize, +# and iosize. What we want to test is that the limit is enforced +# (ie. blksize less than limit but not unduly less - ~85% is kind, +# nowadays we actually get much closer to the limit before EDQUOT. +# +_filter_and_check_blocks() +{ + perl -npe ' + if (/^'$name'\s+([-|+]){2}\s+(\d+)/ && '$enforce') { + $maximum = '$blkhard'; + $minimum = '$blkhard' * 85/100; + if ($2 < $minimum || $2 > $maximum) { + printf(" URK - %d is out of range! [%d,%d] \n", + $2, $minimum, $maximum); + } + s/^('$name'\s+[-|+][-|+]\s+)(\d+)/\1 OK/g; + } + ' | _filter_repquota +} # real QA test starts here mkfs_xfs $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs @@ -83,6 +104,7 @@ cat $tmp.mkfs >>$seq.full _qmount # setup exactly what it is we'll be testing +enforce=1 if src/feature -u $SCRATCH_DEV then type=u ; eval `_choose_uid`; ln $seq.usrquota $seq.out @@ -92,9 +114,11 @@ then elif src/feature -U $SCRATCH_DEV then type=u ; eval `_choose_uid`; ln $seq.uqnoenforce $seq.out + enforce=0 elif src/feature -G $SCRATCH_DEV then type=g ; eval `_choose_gid`; ln $seq.gqnoenforce $seq.out + enforce=0 else _notrun "No quota support at mount time" fi @@ -109,7 +133,7 @@ repquota -$type $SCRATCH_DEV | _filter_repquota echo echo "*** report initial settings" | tee -a $seq.full _file_as_id $SCRATCH_MNT/initme $id $type 1024 0 -setquota -$type $id 100 500 4 10 $SCRATCH_DEV +setquota -$type $id $blksoft $blkhard $inosoft $inohard $SCRATCH_DEV repquota -$type $SCRATCH_DEV | _filter_repquota echo @@ -138,7 +162,7 @@ echo echo "*** push past the hard block limit (expect EDQUOT)" | tee -a $seq.full _file_as_id $SCRATCH_MNT/softie $id $type 1024 540 _qmount -repquota -$type $SCRATCH_DEV | _filter_repquota +repquota -$type $SCRATCH_DEV | _filter_and_check_blocks # success, all done status=0 diff --git a/050.grpquota b/050.grpquota index 8250f9862..742c03b4c 100644 --- a/050.grpquota +++ b/050.grpquota @@ -67,7 +67,7 @@ Block grace time: 7days; Inode grace time: 7days Group used soft hard grace used soft hard grace ---------------------------------------------------------------------- [NAME] -- 0 0 0 3 0 0 -[NAME] ++ 448 100 500 7days 10 4 10 7days +[NAME] ++ OK 100 500 7days 10 4 10 7days diff --git a/050.usrquota b/050.usrquota index 4c17f4fd4..c673c9744 100644 --- a/050.usrquota +++ b/050.usrquota @@ -67,7 +67,7 @@ Block grace time: 7days; Inode grace time: 7days User used soft hard grace used soft hard grace ---------------------------------------------------------------------- [NAME] -- 0 0 0 3 0 0 -[NAME] ++ 448 100 500 7days 10 4 10 7days +[NAME] ++ OK 100 500 7days 10 4 10 7days