From: Nathan Scott Date: Fri, 9 Dec 2005 02:52:22 +0000 (+0000) Subject: QA test updates - fixes for pquota, extsize, fsstress, and ensure mount options passe... X-Git-Tag: v1.1.0~672 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=de6d86177ff8499dc365c0c0d56abf0e66be4672;p=users%2Fhch%2Fxfstests-dev.git QA test updates - fixes for pquota, extsize, fsstress, and ensure mount options passed through to test_dev. Merge of master-melb:xfs-cmds:24763a by kenmcd. --- diff --git a/008 b/008 index 556fa8c8d..f7b1c32e3 100755 --- a/008 +++ b/008 @@ -40,17 +40,23 @@ _do_test() _n="$1" _holes="$2" _param="$3" - + out=$testdir/randholes.$$.$_n echo "" echo "randholes.$_n : $_param" | _filter echo "------------------------------------------" if $here/src/randholes $_param $out >$tmp.out then - # quick check - how many holes did we get? - count=`xfs_bmap $out | egrep -c ': hole'` - # blocks can end up adjacent, therefore number of holes varies - _within_tolerance "holes" $count $_holes 10% -v + # only check if we're not allocating in huge chunks (extsz flag) + if _test_inode_flag extsize $out || _test_inode_flag realtime $out + then + echo "holes is in range" + else + # quick check - how many holes did we get? + count=`xfs_bmap $out | egrep -c ': hole'` + # blocks can end up adjacent, therefore number of holes varies + _within_tolerance "holes" $count $_holes 10% -v + fi else echo " randholes returned $? - see $seq.out.full" echo "--------------------------------------" >>$here/$seq.out.full diff --git a/009 b/009 index 3db441f7e..1e7de482e 100755 --- a/009 +++ b/009 @@ -1,7 +1,7 @@ #! /bin/sh # FS QA Test No. 009 # -# alloc test +# XFS allocator test (preallocation - allocp, resvsp ,etc) # #----------------------------------------------------------------------- # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. diff --git a/013 b/013 index 6ad915baa..1c99e8fba 100755 --- a/013 +++ b/013 @@ -25,7 +25,7 @@ _cleanup() mount -o remount,rw $TEST_DEV >/dev/null 2>&1 # now remove fsstress directory. # N.B. rm(1) on IRIX can find problems when building up a long pathname - # such that what it has is greater the 1024 chars and will + # such that what it has is greater the 1024 chars and will # stop and complain - so get rid of complaint # Ref. pv#935754 rm -rf $testdir/fsstress.$$.* 2>&1 | grep -v 'Path too long' @@ -46,7 +46,7 @@ _do_test() _n="$1" _param="$2" _count="$3" - + out=$testdir/fsstress.$$.$_n rm -rf $out if ! mkdir $out @@ -55,17 +55,16 @@ _do_test() status=1 exit fi - + echo "" echo "-----------------------------------------------" echo "fsstress.$_n : $_param" echo "-----------------------------------------------" # -m limits number of users/groups so check doesn't fail (malloc) later dbgoutfile=$seq.full - if ! $here/ltp/fsstress $_param $FSSTRESS_AVOID -v -m 8 -n $_count -d $out >>$dbgoutfile 2>&1 + if ! $FSSTRESS_PROG $_param $FSSTRESS_AVOID -v -m 8 -n $_count -d $out >>$dbgoutfile 2>&1 then echo " fsstress (count=$_count) returned $? - see $seq.full" - echo "--------------------------------------" >>$here/$seq.full echo "$_n - output from fsstress:" >>$here/$seq.full echo "--------------------------------------" >>$here/$seq.full @@ -110,12 +109,12 @@ rm -f $seq.full exit # Test with error injection: -# +# # (error injection) # fsstress -n 1000 -d $scratch -p 4 -z -f rmdir=10 -f link=10 -f creat=10 \ # -f mkdir=10 -f rename=30 -f stat=30 -f unlink=30 -f truncate=20 \ # -e 1 -# +# # Error values 1 - 6 test IFLUSH # 1 - corrupt buffer being flushed to di_core.di_magic # 2 - corrupt inode being flushed i_d.di_magic diff --git a/016 b/016 index 8e9501ae4..0b0ce5075 100755 --- a/016 +++ b/016 @@ -17,7 +17,7 @@ owner=dxm@sgi.com # start bit by bit to force wiping of stale blocks near the end of the # log. Check the block after the log ends to check for corruption # -# assumptions : +# assumptions : # - given we're only touching a single inode, the block after the # log which is in the middle ag should never be touched. # if it changes, we assume the log is writing over it @@ -63,9 +63,9 @@ _log_traffic() { count=$1 echo "*** generate log traffic" - + out=$SCRATCH_MNT/$$.tmp - + echo " *** mount" if ! _scratch_mount then @@ -75,18 +75,20 @@ _log_traffic() # having any quota enabled (acct/enfd) means extra log traffic - evil! $here/src/feature -U $SCRATCH_DEV && \ - _notrun "Quota are enabled, test needs controlled log traffic" + _notrun "UQuota are enabled, test needs controlled log traffic" $here/src/feature -G $SCRATCH_DEV && \ - _notrun "Quota are enabled, test needs controlled log traffic" - + _notrun "GQuota are enabled, test needs controlled log traffic" + $here/src/feature -P $SCRATCH_DEV && \ + _notrun "PQuota are enabled, test needs controlled log traffic" + echo " *** fiddle" while [ $count -ge 0 ] do - touch $out + touch $out rm $out let "count = count - 1" done - + echo " *** unmount" if ! umount $SCRATCH_DEV then @@ -119,7 +121,7 @@ _log_sunit() else expr $lsunit \* $dbsize fi -} +} _after_log() { diff --git a/017 b/017 index d56465bc3..18bf4707c 100755 --- a/017 +++ b/017 @@ -1,7 +1,7 @@ #! /bin/sh # FS QA Test No. 017 # -# test remount ro - pv 795642 +# test remount ro - pv 795642 # #----------------------------------------------------------------------- # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. @@ -53,11 +53,11 @@ echo "*** test" for l in 0 1 2 3 4 do echo " *** test $l" - ltp/fsstress -d $SCRATCH_MNT -n 1000 $FSSTRESS_AVOID >>$seq.full - + $FSSTRESS_PROG -d $SCRATCH_MNT -n 1000 $FSSTRESS_AVOID >>$seq.full + _scratch_mount -o remount,ro \ || _fail "remount ro failed" - + echo "" >>$seq.full echo "*** xfs_logprint ***" >>$seq.full echo "" >>$seq.full diff --git a/020 b/020 index f52e92eee..967d09b69 100755 --- a/020 +++ b/020 @@ -30,8 +30,7 @@ _cleanup() _filter() { sed "s#$testdir[^ :]*##g; - s#$tmp[^ :]*##g; - s#/proc[^ :]*##g" $1 + s#$tmp[^ :]*##g" $1 } _attr() @@ -81,9 +80,6 @@ testfile=$testdir/attribute_$$ echo "*** list non-existant file" _attr_list $testfile -echo "*** list non-xfs file (in /proc)" -_attr_list /proc/devices - echo "*** list empty file" touch $testfile _attr_list $testfile diff --git a/020.out b/020.out index 66091efcd..3e444be1a 100644 --- a/020.out +++ b/020.out @@ -3,10 +3,6 @@ QA output created by 020 *** print attributes getfattr: : No such file or directory !!! error return -*** list non-xfs file (in /proc) - *** print attributes -getfattr: : Operation not supported - !!! error return *** list empty file *** print attributes *** query non-existant attribute diff --git a/030 b/030 index aa7dce80b..e488ee2d9 100755 --- a/030 +++ b/030 @@ -57,7 +57,7 @@ DSIZE="-dsize=100m" # first we need to ensure there are no bogus secondary # superblocks between the primary and first secondary # superblock (hanging around from earlier tests)... -# +# _scratch_mkfs_xfs $DSIZE >/dev/null 2>&1 if [ $? -ne 0 ] # probably don't have a big enough scratch @@ -66,11 +66,11 @@ then else _scratch_mount src/feature -U $SCRATCH_DEV && \ - _notrun "Quota are enabled, test needs controlled sb recovery" + _notrun "UQuota are enabled, test needs controlled sb recovery" src/feature -G $SCRATCH_DEV && \ - _notrun "Quota are enabled, test needs controlled sb recovery" + _notrun "GQuota are enabled, test needs controlled sb recovery" src/feature -P $SCRATCH_DEV && \ - _notrun "Quota are enabled, test needs controlled sb recovery" + _notrun "PQuota are enabled, test needs controlled sb recovery" umount $SCRATCH_DEV fi clear="" @@ -82,7 +82,7 @@ eval `xfs_db -r -c "sb 1" -c stack $SCRATCH_DEV | perl -ne ' src/devzero -v -1 -n "$clear" $SCRATCH_DEV >/dev/null # now kick off the real repair test... -# +# _scratch_mkfs_xfs $DSIZE | _filter_mkfs 2>$tmp.mkfs . $tmp.mkfs _check_ag 0 diff --git a/033 b/033 index b470cee2f..100f8716c 100755 --- a/033 +++ b/033 @@ -78,9 +78,11 @@ _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs # check we won't get any quota inodes setup on mount _scratch_mount src/feature -U $SCRATCH_DEV && \ - _notrun "Quota are enabled, test needs controlled sb recovery" + _notrun "UQuota are enabled, test needs controlled sb recovery" src/feature -G $SCRATCH_DEV && \ - _notrun "Quota are enabled, test needs controlled sb recovery" + _notrun "GQuota are enabled, test needs controlled sb recovery" +src/feature -P $SCRATCH_DEV && \ + _notrun "PQuota are enabled, test needs controlled sb recovery" umount $SCRATCH_DEV # rootino, rbmino, and rsumino are now set (lets blow em away!) diff --git a/049 b/049 index a63e77849..e42629dd9 100755 --- a/049 +++ b/049 @@ -19,7 +19,7 @@ _cleanup() umount $SCRATCH_MNT/test2 > /dev/null 2>&1 umount $SCRATCH_MNT/test > /dev/null 2>&1 rm -f $tmp.* - + if [ -w $seq.full ] then echo "--- mounts at end (after cleanup)" >> $seq.full @@ -81,9 +81,9 @@ mount -t xfs -o loop $SCRATCH_MNT/test.xfs $SCRATCH_MNT/test >> $seq.full 2>&1 \ || _fail "!!! failed to loop mount xfs" _log "stress" -ltp/fsstress -d $SCRATCH_MNT/test -n 1000 $FSSTRESS_AVOID >> $seq.full 2>&1 \ +$FSSTRESS_PROG -d $SCRATCH_MNT/test -n 1000 $FSSTRESS_AVOID >> $seq.full 2>&1 \ || _fail "!!! stress failed" - + _log "clean" rm -rf $SCRATCH_MNT/test/* >> $seq.full 2>&1 \ || _fail "!!! clean failed" @@ -91,7 +91,7 @@ rm -rf $SCRATCH_MNT/test/* >> $seq.full 2>&1 \ _log "create file for ext2 fs" dd if=/dev/zero of=$SCRATCH_MNT/test/test.ext2 bs=1024 count=10240 >> $seq.full 2>&1 \ || _fail "!!! create file failed" - + _log "Create ext2 fs in file on looped xfs" echo y | mkfs -t ext2 $SCRATCH_MNT/test/test.ext2 >> $seq.full 2>&1 \ || _fail "!!! failed to mkfs ext2 on xfs" @@ -101,21 +101,21 @@ mount -t ext2 -o loop $SCRATCH_MNT/test/test.ext2 $SCRATCH_MNT/test2 >> $seq.ful || _fail "!!! failed to loop mount xfs" _log "stress ext2 on xfs via loop" -ltp/fsstress -d $SCRATCH_MNT/test2 -n 1000 $FSSTRESS_AVOID >> $seq.full 2>&1 \ - || _fail "!!! stress ext2 failed" +$FSSTRESS_PROG -d $SCRATCH_MNT/test2 -n 1000 $FSSTRESS_AVOID >> $seq.full 2>&1 \ + || _fail "!!! stress ext2 failed" _log "clean" rm -rf $SCRATCH_MNT/test/* >> $seq.full 2>&1 \ || _fail "!!! clean failed" - + _log "umount ext2 on xfs" umount $SCRATCH_MNT/test2 >> $seq.full 2>&1 \ || _fail "!!! umount ext2 failed" - + _log "umount xfs" umount $SCRATCH_MNT/test >> $seq.full 2>&1 \ || _fail "!!! umount xfs failed" - + echo "--- mounts at end (before cleanup)" >> $seq.full mount >> $seq.full diff --git a/050 b/050 index fb9825d89..4466279b6 100755 --- a/050 +++ b/050 @@ -58,14 +58,14 @@ inohard=10 # 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) { + if (($2 < $minimum || $2 > $maximum) && '$noextsz') { printf(" URK - %d is out of range! [%d,%d] \n", $2, $minimum, $maximum); } @@ -89,6 +89,14 @@ else QUOTA_FS=$SCRATCH_MNT fi +# Figure out whether we're doing large allocations +# (bail out if they're so large they stuff the test up) +_test_inode_flag extsz-inherit $SCRATCH_MNT +noextsz=$? +extsize=`_test_inode_extsz $SCRATCH_MNT` +[ $extsize -ge 512000 ] && \ + _notrun "Extent size hint is too large ($extsize bytes)" + _qsetup echo "Using output from '" `ls -l $seq.out` "'" >>$seq.full @@ -138,7 +146,6 @@ ls -l $SCRATCH_MNT >>$seq.full _qmount _repquota -$type $QUOTA_FS | _filter_and_check_blocks - # success, all done status=0 exit diff --git a/065 b/065 index 8561a8934..33c35d584 100755 --- a/065 +++ b/065 @@ -2,7 +2,7 @@ # FS QA Test No. 065 # # Testing incremental dumps and cumulative restores with -# "adding, deleting, renaming, linking, and unlinking files and +# "adding, deleting, renaming, linking, and unlinking files and # directories". # Do different operations for each level. # @@ -26,7 +26,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 . ./common.filter . ./common.dump -# IRIX "ls -s" uses a block size of 512, for consistincy on linux use +# IRIX "ls -s" uses a block size of 512, for consistincy on linux use # ls --block-size=512 -s [ $HOSTOS == Linux ] && LS_BLOCKSIZE="--block-size=512" @@ -42,7 +42,7 @@ _my_ls_filter() grep -v total | grep -v "^$" | sed "s/^[ \t]*//g" | \ sed -e 's/.*dumpdir/dumpdir/' |\ egrep -v 'housekeeping|dirattr|dirextattr|namreg|state|tree|dumpdir/$|dumpdir:$' |\ - egrep -v "$restore_dir:" + egrep -v "$restore_dir:" } # real QA test starts here @@ -56,9 +56,11 @@ _supported_os IRIX Linux umount $SCRATCH_DEV 2>/dev/null _scratch_mount $here/src/feature -U $SCRATCH_DEV && \ - _notrun "Quota enabled, test needs controlled xfsdump output" + _notrun "UQuota enabled, test needs controlled xfsdump output" $here/src/feature -G $SCRATCH_DEV && \ - _notrun "Quota enabled, test needs controlled xfsdump output" + _notrun "GQuota enabled, test needs controlled xfsdump output" +$here/src/feature -P $SCRATCH_DEV && \ + _notrun "PQuota enabled, test needs controlled xfsdump output" umount $SCRATCH_DEV # @@ -95,11 +97,11 @@ while [ $i -le $num_dumps ]; do ;; 1) # deleting - rm addedfile2 - rmdir addeddir2 + rm addedfile2 + rmdir addeddir2 rm -rf addeddir3 ;; - 2) + 2) # renaming mv addedfile1 addedfile2 # rename to previous existing file mv addeddir4/addedfile5 addeddir4/addedfile4 @@ -108,7 +110,7 @@ while [ $i -le $num_dumps ]; do ;; 3) # linking - ln addedfile0 linkfile0 + ln addedfile0 linkfile0 ln addedfile0 linkfile0_1 # have a 2nd link to file ln addedfile2 linkfile2 ln addeddir6/addedfile4 linkfile64 @@ -123,18 +125,18 @@ while [ $i -le $num_dumps ]; do 5) # link first - then onto 6) rm -rf * echo 'add6' >addedfile6 - ln addedfile6 linkfile6_1 - ln addedfile6 linkfile6_2 - ln addedfile6 linkfile6_3 + ln addedfile6 linkfile6_1 + ln addedfile6 linkfile6_2 + ln addedfile6 linkfile6_3 ;; 6) # then move the inode that the links point to - mv addedfile6 addedfile6_mv + mv addedfile6 addedfile6_mv rm linkfile6_1 rm linkfile6_2 rm linkfile6_3 ln addedfile6_mv linkfile6_mv_1 - ln addedfile6_mv linkfile6_mv_2 - ln addedfile6_mv linkfile6_mv_3 + ln addedfile6_mv linkfile6_mv_2 + ln addedfile6_mv linkfile6_mv_3 ;; esac cd $here @@ -146,7 +148,7 @@ while [ $i -le $num_dumps ]; do dump_file=$tmp.df.level$i _do_dump_file -l $i - i=`expr $i + 1` + i=`expr $i + 1` done echo "Look at what files are contained in the inc. dump" @@ -156,7 +158,7 @@ while [ $i -le $num_dumps ]; do echo "restoring from df.level$i" dump_file=$tmp.df.level$i _do_restore_toc - i=`expr $i + 1` + i=`expr $i + 1` done echo "Do the cumulative restores" @@ -169,7 +171,7 @@ while [ $i -le $num_dumps ]; do echo "ls -sRF restore_dir" ls -sRF $LS_BLOCKSIZE $restore_dir | _my_ls_filter |\ _check_quota_file | tee $tmp.restorals.$i - i=`expr $i + 1` + i=`expr $i + 1` done echo "" @@ -179,7 +181,7 @@ while [ $i -le $num_dumps ]; do echo "Comparing ls of FS with restored FS at level $i" diff -s $tmp.ls.$i $tmp.restorals.$i | sed "s#$tmp#TMP#g" echo "" - i=`expr $i + 1` + i=`expr $i + 1` done diff --git a/068 b/068 index df1d1236f..eb8b93620 100755 --- a/068 +++ b/068 @@ -66,7 +66,7 @@ touch $tmp.running while [ -f "$tmp.running" ] do # -w ensures that the only ops are ones which cause write I/O - ltp/fsstress -d $STRESS_DIR -w -p $procs -n $nops $FSSTRESS_AVOID \ + $FSSTRESS_PROG -d $STRESS_DIR -w -p $procs -n $nops $FSSTRESS_AVOID \ > /dev/null 2>&1 done diff --git a/070 b/070 index ecb151f9a..65e158af9 100755 --- a/070 +++ b/070 @@ -35,7 +35,7 @@ _supported_os IRIX Linux _setup_testdir -$here/ltp/fsstress \ +$FSSTRESS_PROG \ -d $testdir/fsstress \ -f allocsp=0 \ -f freesp=0 \ diff --git a/075 b/075 index fc1d6a62c..7f5dd91a5 100755 --- a/075 +++ b/075 @@ -65,8 +65,10 @@ _do_test() cd $out if ! $here/ltp/fsx $_param -P $here $seq.$_n >/dev/null then - echo " fsx ($_param) returned $? - see $seq.$_n.full" - mv $seq.$_n.fsxlog $here/$seq.$_n.full + echo " fsx ($_param) failed, $? - compare $seq.$_n.{good,bad,fsxlog}" + mv $out/$seq.$_n $here/$seq.$_n.full + od -xAx $here/$seq.$_n.full > $here/$seq.$_n.bad + od -xAx $here/$seq.$_n.fsxgood > $here/$seq.$_n.good status=1 exit fi diff --git a/076 b/076 index e423c3632..975de2e24 100755 --- a/076 +++ b/076 @@ -60,7 +60,7 @@ echo "*** test concurrent block/fs access" cat $SCRATCH_DEV >/dev/null & pid=$! -ltp/fsstress -d $SCRATCH_MNT -p 2 -n 2000 $FSSTRESS_AVOID >>$seq.full +$FSSTRESS_PROG -d $SCRATCH_MNT -p 2 -n 2000 $FSSTRESS_AVOID >>$seq.full _lets_get_pidst _check_scratch_fs diff --git a/083 b/083 index 55b801c6a..70d721231 100755 --- a/083 +++ b/083 @@ -64,7 +64,7 @@ workout() || _fail "mount failed" # -w ensures that the only ops are ones which cause write I/O - ltp/fsstress -d $SCRATCH_MNT -w -p $procs -n $nops $FSSTRESS_AVOID \ + $FSSTRESS_PROG -d $SCRATCH_MNT -w -p $procs -n $nops $FSSTRESS_AVOID \ >>$seq.full _check_scratch_fs } diff --git a/086 b/086 index 6b971a621..8a75e6d14 100755 --- a/086 +++ b/086 @@ -31,7 +31,7 @@ _supported_os IRIX Linux rm -f $seq.full $tmp.* _require_scratch -_require_v2log +_require_v2log echo "*** init FS" umount $SCRATCH_DEV >/dev/null 2>&1 diff --git a/087 b/087 index d4d690b18..a97fdae5d 100755 --- a/087 +++ b/087 @@ -32,7 +32,7 @@ _do_meta() param="-p 4 -z -f rmdir=10 -f link=10 -f creat=10 -f mkdir=10 \ -f rename=30 -f stat=30 -f unlink=30 -f truncate=20" _echofull "calling fsstress $param -m8 -n $count" - if ! $here/ltp/fsstress $param $FSSTRESS_AVOID -m 8 -n $count -d $out >>$seq.full 2>&1 + if ! $FSSTRESS_PROG $param $FSSTRESS_AVOID -m 8 -n $count -d $out >>$seq.full 2>&1 then _echofull "fsstress failed" fi diff --git a/096 b/096 index 521b7a05c..6491eab5e 100755 --- a/096 +++ b/096 @@ -30,7 +30,7 @@ _cleanup() . ./common.filter . ./common.log -# +# # filter out counts which will vary # - blocks, agsize, agcount, device name # filter out differences between linux and irix: @@ -48,7 +48,7 @@ _cleanup() # log =internal log bsize=4096 blocks=N, version=1 # = sunit=0 blks # realtime =none extsz=65536 blocks=N, rtextents=0 -# +# _mkfs_filter() { tee -a $seq.full | \ @@ -58,7 +58,7 @@ _mkfs_filter() -e 's/agcount=[0-9][0-9]*/agcount=N/' \ -e 's/meta-data=[^ ]*/meta-data=DEV/' \ -e 's/ *isize/ isize/' \ - -e '/ *= *sectsz=[0-9][0-9]* *$/d' \ + -e '/ *= *sectsz=[0-9][0-9]* *attr=[0-9][0-9]*$/d' \ -e '/ *= *mmr=[0-9][0-9]* *$/d' \ -e 's/ *mixed-case=[YN]//' \ -e 's/sectsz=[0-9][0-9]* *//' \ diff --git a/104 b/104 index c2587cfbc..2ddbbda64 100644 --- a/104 +++ b/104 @@ -35,7 +35,7 @@ _create_scratch() exit 1 fi } - + _fill_scratch() { $XFS_IO_PROG -f -c "resvsp 0 ${1}" $SCRATCH_MNT/resvfile @@ -46,7 +46,7 @@ _stress_scratch() procs=3 nops=1000 # -w ensures that the only ops are ones which cause write I/O - ltp/fsstress -d $SCRATCH_MNT -w -p $procs -n $nops $FSSTRESS_AVOID & + $FSSTRESS_PROG -d $SCRATCH_MNT -w -p $procs -n $nops $FSSTRESS_AVOID & } # real QA test starts here @@ -71,10 +71,10 @@ fillsize=`expr 110 \* 1048576` # 110 megabytes of filling echo "*** using some initial space on scratch filesystem" _fill_scratch $fillsize -# +# # Grow the filesystem while actively stressing it... # Kick off more stress threads on each iteration, grow; repeat. -# +# while [ $size -le $endsize ]; do echo "*** stressing a ${size} byte filesystem" echo "*** stressing a ${sizeb} block filesystem" >> $seq.full diff --git a/106 b/106 index 1fee87f0c..10a80f1bb 100755 --- a/106 +++ b/106 @@ -2,6 +2,8 @@ # FS QA Test No. 106 # # Exercise basic xfs_quota functionality (user/group/project quota) +# Use of "sync" mount option here is an attempt to get deterministic +# allocator behaviour. # #----------------------------------------------------------------------- # Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved. @@ -35,13 +37,17 @@ cat $tmp.mkfs >$seq.full . $tmp.mkfs # setup a default run -[ -z "$MOUNT_OPTIONS" ] && export MOUNT_OPTIONS="-o uquota" +if [ -z "$MOUNT_OPTIONS" ]; then + export MOUNT_OPTIONS="-o pquota,sync" +else + export MOUNT_OPTIONS="$MOUNT_OPTIONS -o sync" +fi # initial populate _qmount target=$SCRATCH_MNT/target -ltp/fsstress -s 0xdeed -m8 -w -p4 -n1000 $FSSTRESS_AVOID -d $target -ltp/fsstress -s 0xdeed -m8 -z -p4 -n1000 -fchproj=500 -fchown=500 -d $target +$FSSTRESS_PROG -s 0xdeed -m8 -w -p4 -n1000 $FSSTRESS_AVOID -d $target +$FSSTRESS_PROG -s 0xdeed -m8 -z -p4 -n1000 -fsetxattr=500 -fchown=500 -d $target # also use space, to be able to go over/under limits easily uid=255 @@ -167,19 +173,19 @@ test_xfs_quota() } # real QA test starts here -export MOUNT_OPTIONS="-ouquota" +export MOUNT_OPTIONS="-ouquota,sync" _qmount type=u id=$uid test_xfs_quota | filter_xfs_quota -export MOUNT_OPTIONS="-ogquota" +export MOUNT_OPTIONS="-ogquota,sync" _qmount type=g id=$gid test_xfs_quota | filter_xfs_quota -export MOUNT_OPTIONS="-opquota" +export MOUNT_OPTIONS="-opquota,sync" _qmount type=p id=$prid diff --git a/107 b/107 index 84467ec6a..302b3ca80 100755 --- a/107 +++ b/107 @@ -1,7 +1,9 @@ #! /bin/sh # FS QA Test No. 107 # -# Project quota +# Project quota. +# Use of "sync" mount option here is an attempt to get deterministic +# allocator behaviour. # #----------------------------------------------------------------------- # Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved. @@ -47,7 +49,11 @@ cat $tmp.mkfs >$seq.full . $tmp.mkfs # setup a default run -[ -z "$MOUNT_OPTIONS" ] && export MOUNT_OPTIONS="-o pquota" +if [ -z "$MOUNT_OPTIONS" ]; then + export MOUNT_OPTIONS="-o pquota,sync" +else + export MOUNT_OPTIONS="$MOUNT_OPTIONS -o sync" +fi _qmount src/feature -p $SCRATCH_MNT && _notrun "Cannot run without project quota" @@ -60,8 +66,8 @@ echo "6:$target" | tee -a $seq.full > $tmp.projects echo "### populate filesystem" mkdir $target || exit FSSTRESS_AVOID="$FSSTRESS_AVOID -fmknod=0 -fsymlink=0" -ltp/fsstress -s 0xfeed -m8 -w -p4 -n1000 $FSSTRESS_AVOID -d $target -ltp/fsstress -s 0xbabe -m8 -z -p4 -n500 -fchproj=250 -fchown=250 -d $target +$FSSTRESS_PROG -s 0xfeed -m8 -w -p4 -n1000 $FSSTRESS_AVOID -d $target +$FSSTRESS_PROG -s 0xbabe -m8 -z -p4 -n500 -fsetxattr=250 -fchown=250 -d $target QARGS="-x -D $tmp.projects -P /dev/null $SCRATCH_MNT" diff --git a/114 b/114 index 37a054d02..5048a2734 100755 --- a/114 +++ b/114 @@ -238,8 +238,8 @@ _test_fsstress() -f symlink=10 \ -n $count -d $out -p 3" - echo "ltp/fsstress $args" | sed -e "s#$out#outdir#" - if ! $here/ltp/fsstress $args | _filter_num + echo "fsstress $args" | sed -e "s#$out#outdir#" + if ! $FSSTRESS_PROG $args | _filter_num then echo " fsstress $args returned $?" cat $tmp.out | tee -a $here/$seq.full @@ -267,7 +267,7 @@ _test_dirstress() fi args="-d $out -f $count -k -p 3 -n 1" - echo "src/dirstress $args" | sed -e "s#$out#outdir#" + echo "dirstress $args" | sed -e "s#$out#outdir#" if ! $here/src/dirstress $args >$tmp.out 2>&1 | _filter_num then echo " dirstress failed" @@ -278,7 +278,7 @@ _test_dirstress() fi args="-d $out -f $count -k -p 3 -n 5" - echo "src/dirstress $args" | sed -e "s#$out#outdir#" + echo "dirstress $args" | sed -e "s#$out#outdir#" if ! $here/src/dirstress $args >$tmp.out 2>&1 | _filter_num then echo " dirstress failed" diff --git a/114.out b/114.out index 2549cf285..a36396e26 100644 --- a/114.out +++ b/114.out @@ -350,7 +350,7 @@ succeeded checking I inodes Testing fsstress -ltp/fsstress -z -f rmdir=10 -f link=10 -f creat=10 -f mkdir=10 -f rename=30 -f unlink=10 -f symlink=10 -n 1000 -d outdir -p 3 +fsstress -z -f rmdir=10 -f link=10 -f creat=10 -f mkdir=10 -f rename=30 -f unlink=10 -f symlink=10 -n 1000 -d outdir -p 3 seed = S Check parent @@ -358,8 +358,8 @@ succeeded checking I inodes Testing dirstress -src/dirstress -d outdir -f 1000 -k -p 3 -n 1 -src/dirstress -d outdir -f 1000 -k -p 3 -n 5 +dirstress -d outdir -f 1000 -k -p 3 -n 1 +dirstress -d outdir -f 1000 -k -p 3 -n 5 Check parent succeeded checking I inodes diff --git a/117 b/117 index e2c511273..5fee41649 100755 --- a/117 +++ b/117 @@ -36,7 +36,7 @@ _cleanup() . ./common.filter # real QA test starts here -_supported_fs xfs +_supported_fs xfs _supported_os IRIX Linux _setup_testdir @@ -51,14 +51,14 @@ _scratch_mkfs_xfs >>$seq.full 2>&1 \ _scratch_mount >>$seq.full 2>&1 \ || _fail "mount failed" -mkdir -p $SCRATCH_MNT/fsstress +mkdir -p $SCRATCH_MNT/fsstress echo echo Running fsstress in serial: i=0 while [ $i -lt $ITERATIONS ]; do echo fsstress iteration: $i | tee -a $seq.full - $here/ltp/fsstress \ + $FSSTRESS_PROG \ -d $SCRATCH_MNT/fsstress \ -f allocsp=0 \ -f freesp=0 \ diff --git a/common.config b/common.config index 7e485eb76..5d9bc46e9 100644 --- a/common.config +++ b/common.config @@ -54,6 +54,7 @@ export CHECK_OPTIONS=${CHECK_OPTIONS:="-g auto"} export BENCH_PASSES=${BENCH_PASSES:=5} export XFS_MKFS_OPTIONS=${XFS_MKFS_OPTIONS:=-bsize=4096} +export PWD=`pwd` #export DEBUG=${DEBUG:=...} # arbitrary CFLAGS really. export MALLOCLIB=${MALLOCLIB:=/usr/lib/libefence.a} export LOCAL_CONFIGURE_OPTIONS=${LOCAL_CONFIGURE_OPTIONS:=--enable-readline=yes} @@ -93,21 +94,24 @@ _fatal() export MKFS_PROG="`set_prog_path mkfs`" [ "$MKFS_PROG" = "" ] && _fatal "mkfs not found" -export AWK_PROG="`set_prog_path awk`" -[ "$AWK_PROG" = "" ] && _fatal "awk not found" - export MOUNT_PROG="`set_prog_path mount`" [ "$MOUNT_PROG" = "" ] && _fatal "mount not found" export UMOUNT_PROG="`set_prog_path umount`" [ "$UMOUNT_PROG" = "" ] && _fatal "umount not found" +export FSSTRESS_PROG="`set_prog_path fsstress $PWD/ltp/fsstress`" +[ "$FSSTRESS_PROG" = "" ] && _fatal "fsstress not found" + export NSLOOKUP_PROG="`set_prog_path nslookup`" [ "$NSLOOKUP_PROG" = "" ] && _fatal "nslookup not found" export PERL_PROG="`set_prog_path perl`" [ "$PERL_PROG" = "" ] && _fatal "perl not found" +export AWK_PROG="`set_prog_path awk`" +[ "$AWK_PROG" = "" ] && _fatal "awk not found" + export SED_PROG="`set_prog_path sed`" [ "$SED_PROG" = "" ] && _fatal "sed not found" @@ -153,7 +157,7 @@ known_hosts() TEST_LOGDEV=/dev/hdb3 SCRATCH_LOGDEV=/dev/hdb5 #SCRATCH_RTDEV=/dev/hdb6 - RMT_TAPE_DEV=bruce:/dev/st0 + #RMT_TAPE_DEV=bruce:/dev/st0 RMT_IRIXTAPE_DEV=snort:/dev/tape RMT_TAPE_USER=guest ;; @@ -163,16 +167,15 @@ known_hosts() SCRATCH_MNT=/mnt/xfs0 SCRATCH_DEV=/dev/sdb5 #SCRATCH_RTDEV=/dev/sdc1 - #SCRATCH_RTDEV=/dev/md0 SCRATCH_LOGDEV=/dev/sda11 TEST_DIR=/mnt/xfs1 TEST_DEV=/dev/sdc3 #TEST_RTDEV=/dev/sdb6 TEST_LOGDEV=/dev/sda9 - TAPE_DEV=/dev/st0 - RMT_TAPE_DEV=bruce:/dev/st0 - RMT_IRIXTAPE_DEV=snort:/dev/tape - RMT_TAPE_USER=guest + #TAPE_DEV=/dev/st0 + #RMT_TAPE_DEV=bruce:/dev/st0 + #RMT_IRIXTAPE_DEV=snort:/dev/tape + #RMT_TAPE_USER=guest ;; frodo) MODULAR=0 diff --git a/common.dump b/common.dump index dc03c26c7..2ed5e100d 100644 --- a/common.dump +++ b/common.dump @@ -1,6 +1,6 @@ #/bin/sh # -# Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. +# Copyright (c) 2000-2002,2005 Silicon Graphics, Inc. All Rights Reserved. # # Functions useful for xfsdump/xfsrestore tests # @@ -13,7 +13,7 @@ if [ -n "$DEBUGDUMP" ]; then _restore_debug=-v4 _invutil_debug=-d fi - + # Use dump/restore in qa directory for debugging PATH="$here:$PATH" export PATH @@ -61,7 +61,7 @@ have_mtvariable=false _mt() { op=$1 - if _isrmt; then + if _isrmt; then # REMOTE _rmtdev=`echo $dumptape | $AWK_PROG -F: '{print $2}'` @@ -84,12 +84,12 @@ _check_onl() { _limit=10 i=0 - while [ $i -lt $_limit ]; do + while [ $i -lt $_limit ]; do echo "Checking online..." >>$here/$seq.full if _mt status >$tmp.status 2>&1; then - break; + break; else - sleep 2 + sleep 1 fi i=`expr $i + 1` done @@ -99,10 +99,10 @@ _check_onl() echo "ERROR: mt -f $dumptape failed" cat $tmp.status - echo "mt -f $dumptape failed" >$seq.notrun + echo "mt -f $dumptape failed" >$seq.notrun status=$NOTRUNSTS exit - fi + fi if egrep -i 'onl|ready' $tmp.status | grep -iv 'not ready' >/dev/null; then @@ -111,7 +111,7 @@ _check_onl() echo "ERROR: $dumptape is not online" cat $tmp.status - echo "dumptape, $dumptape, is not online" >$seq.notrun + echo "dumptape, $dumptape, is not online" >$seq.notrun status=$NOTRUNSTS exit fi @@ -122,12 +122,12 @@ _wait_tape() echo "Wait for tape, $dumptape, ..." >>$here/$seq.full i=0 - while [ $i -lt 20 ]; do + while [ $i -lt 20 ]; do echo "Checking status..." >>$here/$seq.full if _mt status 2>&1 | tee -a $here/$seq.full | egrep -i "onl|ready" >/dev/null; then - break; + break; else - sleep 2 + sleep 1 fi i=`expr $i + 1` done @@ -145,7 +145,7 @@ _rewind() } # -# Do a custom erase because: +# Do a custom erase because: # (i) some machines don't support it # (ii) some machines take forever to do it # @@ -181,7 +181,7 @@ _set_variable() # LOCAL echo "Put scsi tape driver into variable block size mode" mt -f $dumptape setblk 0 - fi + fi } _require_tape() @@ -190,7 +190,7 @@ _require_tape() if [ -z "$dumptape" ]; then echo "This test requires a dump tape - none was specified" - echo "No dump tape specified" >$seq.notrun + echo "No dump tape specified" >$seq.notrun status=$NOTRUNSTS exit fi @@ -207,7 +207,7 @@ _wipe_fs() _scratch_mount >>$here/$seq.full || _fail "mount failed" } -# +# # Cleanup created dirs and files # Called by trap # @@ -255,7 +255,7 @@ _stable_fs() } # -# Run fsstress to create a mixture of +# Run fsstress to create a mixture of # files,dirs,links,symlinks # # Pinched from test 013. @@ -281,7 +281,7 @@ _create_dumpdir_stress() if ! $here/ltp/fsstress $_param -s 1 $FSSTRESS_AVOID -n $_count -d $dump_dir >$tmp.out 2>&1 then echo " fsstress (count=$_count) returned $? - see $here/$seq.full" - + echo "--------------------------------------" >>$here/$here/$seq.full echo "output from fsstress:" >>$here/$here/$seq.full echo "--------------------------------------" >>$here/$here/$seq.full @@ -376,7 +376,7 @@ _mk_fillconfig_ea() cat <$tmp.config # pathname size user group perm name value namespace # -smalll 10 $nobody $nobody 777 attr1 some_text user +smalll 10 $nobody $nobody 777 attr1 some_text user biggg 102400 $nobody $nobody 777 attr2 some_text2 root sub/smalll 10 $nobody $nobody 777 attr3 some_text3 user sub/biggg 102400 $nobody $nobody 777 attr4 some_text4 root @@ -411,7 +411,7 @@ End-of-File _mk_fillconfig_xattr() { cat <$tmp.config -# pathname size user group perm name +# pathname size user group perm name # xflag_realtime 10 $nobody $nobody 777 XFS_XFLAG_REALTIME xflag_prealloc 10 $nobody $nobody 777 XFS_XFLAG_PREALLOC @@ -443,7 +443,7 @@ _do_create_dumpdir_fill() do if [ $nbytes = "d" ]; then # create a directory - dir=$file + dir=$file if [ ! -d $dir ] then if mkdir $dir @@ -520,7 +520,7 @@ _create_dumpdir_largefile() POSIXLY_CORRECT=yes \ dd if=/dev/zero of=$_largefile bs=1 seek=$_largesize count=10 2>&1 _stable_fs -} +} _create_dumpdir_fill() { @@ -528,7 +528,7 @@ _create_dumpdir_fill() _mk_fillconfig1 _do_create_dumpdir_fill _stable_fs -} +} _create_dumpdir_fill2() { @@ -536,7 +536,7 @@ _create_dumpdir_fill2() _mk_fillconfig2 _do_create_dumpdir_fill _stable_fs -} +} _create_dumpdir_fill_perm() { @@ -544,7 +544,7 @@ _create_dumpdir_fill_perm() _mk_fillconfig_perm _do_create_dumpdir_fill _stable_fs -} +} _create_dumpdir_fill_ea() { @@ -552,7 +552,7 @@ _create_dumpdir_fill_ea() _mk_fillconfig_ea _do_create_dumpdir_fill _stable_fs -} +} # @@ -565,8 +565,8 @@ _append_dumpdir_fill() cat <$tmp.config # pathname # -small -sub/big +small +sub/big # sub/a sub/c @@ -621,7 +621,7 @@ _do_create_dump_symlinks() fi ln -s $file $file-link if [ -n "$perms2" ]; then - umask $omask + umask $omask fi if [ -n "$owner" -a -n "$group" ]; then @@ -643,7 +643,7 @@ _do_create_dump_symlinks() _mk_symlink_config() { cat <$tmp.config -# path size owner1 group1 owner2 group2 perm1 perm2 +# path size owner1 group1 owner2 group2 perm1 perm2 # a 0 $nobody $nobody daemon sys 124 421 b 0 daemon sys bin bin 347 743 @@ -658,14 +658,14 @@ _create_dumpdir_symlinks() _mk_symlink_config _do_create_dump_symlinks _stable_fs -} +} # # create hardlinks of form $_fname, $_fname_h1 $_fname_h2 ... # _create_hardlinks() { - _fname=$1 + _fname=$1 _numlinks=$2 touch $_fname @@ -750,10 +750,10 @@ _filter_devchar() } { print } ' -} +} -# +# # Filter out the non-deterministic dump msgs from # xfsdump and xfsrestore # @@ -841,7 +841,7 @@ _dir_filter() } # -# Note: requires a space between option letter and argument +# Note: requires a space between option letter and argument # _parse_args() { @@ -853,7 +853,7 @@ _parse_args() in -f) [ -z "$2" ] && _fail "missing argument for -f" - dumptape=$2 + dumptape=$2 shift ;; -L) @@ -900,7 +900,7 @@ _do_dump_sub() echo "Dumping to tape..." opts="$_dump_debug$dump_args -s $dump_sdir -f $dumptape -M $media_label -L $session_label $SCRATCH_MNT" - echo "xfsdump $opts" | _dir_filter + echo "xfsdump $opts" | _dir_filter xfsdump $opts 2>&1 | tee -a $here/$seq.full | _dump_filter } @@ -913,7 +913,7 @@ _do_dump() echo "Dumping to tape..." opts="$_dump_debug$dump_args -f $dumptape -M $media_label -L $session_label $SCRATCH_MNT" - echo "xfsdump $opts" | _dir_filter + echo "xfsdump $opts" | _dir_filter xfsdump $opts 2>&1 | tee -a $here/$seq.full | _dump_filter } @@ -928,7 +928,7 @@ _do_dump_min() echo "Dumping to tape..." onemeg=1048576 opts="$_dump_debug$dump_args -m -b $onemeg -l0 -f $dumptape -M $media_label -L $session_label $SCRATCH_MNT" - echo "xfsdump $opts" | _dir_filter + echo "xfsdump $opts" | _dir_filter xfsdump $opts 2>&1 | tee -a $here/$seq.full | _dump_filter } @@ -942,7 +942,7 @@ _do_dump_file() echo "Dumping to file..." opts="$_dump_debug$dump_args -f $dump_file -M $media_label -L $session_label $SCRATCH_MNT" - echo "xfsdump $opts" | _dir_filter + echo "xfsdump $opts" | _dir_filter xfsdump $opts 2>&1 | tee -a $here/$seq.full | _dump_filter } @@ -964,7 +964,7 @@ _do_dump_multi_file() echo "Dumping to files..." opts="$_dump_debug$dump_args $multi_args -L $session_label $SCRATCH_MNT" - echo "xfsdump $opts" | _dir_filter + echo "xfsdump $opts" | _dir_filter xfsdump $opts 2>&1 | tee -a $here/$seq.full | _dump_filter } @@ -998,7 +998,7 @@ _do_restore() echo "Restoring from tape..." opts="$_restore_debug -f $dumptape -L $session_label $restore_dir" - echo "xfsrestore $opts" | _dir_filter + echo "xfsrestore $opts" | _dir_filter xfsrestore $opts 2>&1 | tee -a $here/$seq.full | _dump_filter } @@ -1013,7 +1013,7 @@ _do_restore_min() echo "Restoring from tape..." onemeg=1048576 opts="$_restore_debug -m -b $onemeg -f $dumptape -L $session_label $restore_dir" - echo "xfsrestore $opts" | _dir_filter + echo "xfsrestore $opts" | _dir_filter xfsrestore $opts 2>&1 | tee -a $here/$seq.full | _dump_filter } @@ -1027,7 +1027,7 @@ _do_restore_file() echo "Restoring from file..." opts="$_restore_debug -f $dump_file -L $session_label $restore_dir" - echo "xfsrestore $opts" | _dir_filter + echo "xfsrestore $opts" | _dir_filter xfsrestore $opts 2>&1 | tee -a $here/$seq.full | _dump_filter } @@ -1044,7 +1044,7 @@ _do_restore_file_cum() echo "Restoring cumumlative from file..." opts="$_restore_debug -f $dump_file -r $restore_dir" - echo "xfsrestore $opts" | _dir_filter + echo "xfsrestore $opts" | _dir_filter xfsrestore $opts 2>&1 | tee -a $here/$seq.full | _dump_filter } @@ -1084,7 +1084,7 @@ _do_restore_multi_file() echo "Restoring from file..." opts="$_restore_debug $multi_args -L $session_label $restore_dir" - echo "xfsrestore $opts" | _dir_filter + echo "xfsrestore $opts" | _dir_filter xfsrestore $opts 2>&1 | tee -a $here/$seq.full | _dump_filter } @@ -1100,7 +1100,7 @@ _do_dump_restore() echo "xfsdump|xfsrestore ..." restore_opts="$_restore_debug - $restore_dir" dump_opts="$_dump_debug$dump_args -s $dump_sdir - $SCRATCH_MNT" - echo "xfsdump $dump_opts | xfsrestore $restore_opts" | _dir_filter + echo "xfsdump $dump_opts | xfsrestore $restore_opts" | _dir_filter xfsdump $dump_opts 2>$tmp.dump.mlog | xfsrestore $restore_opts 2>&1 | tee -a $here/$seq.full | _dump_filter _dump_filter <$tmp.dump.mlog } @@ -1122,7 +1122,6 @@ _ls_compare_sub() | sed -e "s#$restore_sdir\/##" >$tmp.restore_dir diff -bcs $tmp.dump_dir $tmp.restore_dir | sed -e "s#$tmp#TMP#g" - } # @@ -1245,7 +1244,7 @@ _dump_inventory() # # Do the xfsinvutil cmd with debug and filters -# Need to set variable: "$middate" to the invutil date +# Need to set variable: "$middate" to the invutil date # _do_invutil() { @@ -1263,13 +1262,25 @@ _check_quota() { usermsg=$1 groupmsg=$2 + projectmsg=$3 uquota=0 - gquota=0 + gquota=0 + pquota=0 $here/src/feature -U $SCRATCH_DEV && uquota=1 $here/src/feature -G $SCRATCH_DEV && gquota=1 - - $AWK_PROG -v uquota=$uquota -v gquota=$gquota -v full=$here/$seq.full \ - -v usermsg="$usermsg" -v groupmsg="$groupmsg" ' + $here/src/feature -P $SCRATCH_DEV && pquota=1 + + $AWK_PROG -v uquota=$uquota -v gquota=$gquota -v pquota=$pquota \ + -v full=$here/$seq.full -v usermsg="$usermsg" \ + -v groupmsg="$groupmsg" -v projectmsg="$projectmsg" ' + $0 ~ projectmsg { + print "Found project quota:", $0 >>full + found_pquota = 1 + if (!pquota) { + print "Found extra:", $0 + } + next + } $0 ~ groupmsg { print "Found group quota:", $0 >>full found_gquota = 1 @@ -1294,25 +1305,31 @@ _check_quota() if (gquota && !found_gquota) { print "Missing group quota msg:", groupmsg } + if (pquota && !found_pquota) { + print "Missing project quota msg:", projectmsg + } } ' } # -# xfsrestore: 3 directories and 40 entries processed -# $5 = 40 -# num entries needs to be reduced by num quota file(s) +# xfsrestore: 3 directories and 40 entries processed +# $5 = 40 +# num entries needs to be reduced by num quota file(s) # _check_quota_entries() { uquota=0 - gquota=0 + gquota=0 + pquota=0 $here/src/feature -U $SCRATCH_DEV && uquota=1 $here/src/feature -G $SCRATCH_DEV && gquota=1 - $AWK_PROG -v uquota=$uquota -v gquota=$gquota ' - /entries processed/ { + $here/src/feature -P $SCRATCH_DEV && pquota=1 + $AWK_PROG -v uquota=$uquota -v gquota=$gquota -v pquota=$pquota ' + /entries processed/ { if (uquota) $5-- if (gquota) $5-- + if (pquota) $5-- } {print}' } @@ -1321,8 +1338,10 @@ _check_quota_entries() # Look for: # xfsdump: saving user quota information for: SCRATCH_MNT # xfsdump: saving group quota information for: SCRATCH_MNT +# xfsdump: saving project quota information for: SCRATCH_MNT # xfsrestore: user quota information written to ...' # xfsrestore: group quota information written to ...' +# xfsrestore: project quota information written to ...' # # If on IRIX then look for: # xfsrestore: use 'edquota' to restore quotas @@ -1331,11 +1350,13 @@ _check_quota_dumprestore() { if [ "$HOSTOS" == "IRIX" ]; then _check_quota 'user quota information' \ - 'group quota information' |\ + 'group quota information' \ + 'project quota information' | \ sed "/xfsrestore:.*use 'edquota' to restore quotas/d" else _check_quota 'user quota information' \ - 'group quota information' + 'group quota information' \ + 'project quota information' fi } @@ -1343,11 +1364,13 @@ _check_quota_dumprestore() # Look for: # Only in RESTORE_DIR: xfsdump_quotas # Only in RESTORE_DIR: xfsdump_quotas_group +# Only in RESTORE_DIR: xfsdump_quotas_project # _check_quota_diff() { _check_quota 'Only in RESTORE_DIR: xfsdump_quotas' \ - 'Only in RESTORE_DIR: xfsdump_quotas_group' + 'Only in RESTORE_DIR: xfsdump_quotas_group' \ + 'Only in RESTORE_DIR: xfsdump_quotas_proj' } # @@ -1358,7 +1381,7 @@ _check_quota_diff() # _check_quota_file() { - _check_quota 'xfsdump_quotas' 'xfsdump_quotas_group' + _check_quota 'xfsdump_quotas' 'xfsdump_quotas_group' 'xfsdump_quotas_proj' } diff --git a/common.rc b/common.rc index 7d5c0212a..971c676c0 100644 --- a/common.rc +++ b/common.rc @@ -671,6 +671,7 @@ _check_xfs_filesystem() extra_rt_options="-r$3" extra_mount_options=$extra_mount_options" -ortdev=$3" fi + extra_mount_options=$extra_mount_options" $MOUNT_OPTIONS" [ "$FSTYP" != xfs ] && return 0 testoption="" @@ -1067,7 +1068,6 @@ _descend() # _populate_fs() { - here=`pwd` dirs=5 # ndirs in each subdir till leaves size=0 # sizeof files in K @@ -1088,7 +1088,6 @@ _populate_fs() esac done - _descend $root $depth wait @@ -1112,6 +1111,21 @@ _test_inode_flag() return 1 } +# query the given files extsize allocator hint in bytes (if any) +# +_test_inode_extsz() +{ + file=$1 + blocks="" + + if which $XFS_IO_PROG >/dev/null; then + blocks=`$XFS_IO_PROG -r -c 'stat' "$file" | \ + awk '/^xattr.extsize =/ { print $3 }'` + fi + [ -z "$blocks" ] && blocks="0" + echo $blocks +} + ################################################################################ diff --git a/configure.in b/configure.in index a9c638dee..a2d758119 100644 --- a/configure.in +++ b/configure.in @@ -39,6 +39,8 @@ in AC_PACKAGE_NEED_ATTRIBUTES_H AC_PACKAGE_WANT_NDBM AC_PACKAGE_NEED_IRIX_LIBHANDLE + have_attr_list=true + AC_SUBST(have_attr_list) ;; *) AC_PACKAGE_NEED_XFS_LIBXFS_H @@ -49,6 +51,7 @@ in AC_PACKAGE_NEED_ATTRLIST_LIBHANDLE AC_PACKAGE_NEED_ATTR_XATTR_H AC_PACKAGE_NEED_ATTRIBUTES_H + AC_PACKAGE_WANT_ATTRLIST_LIBATTR AC_PACKAGE_NEED_GETXATTR_LIBATTR AC_PACKAGE_NEED_SYS_ACL_H diff --git a/include/builddefs.in b/include/builddefs.in index d07fe0771..3d7c62559 100644 --- a/include/builddefs.in +++ b/include/builddefs.in @@ -49,6 +49,7 @@ RPM_VERSION = @rpm_version@ ENABLE_SHARED = @enable_shared@ HAVE_DB = @have_db@ HAVE_AIO = @have_aio@ +HAVE_ATTR_LIST = @have_attr_list@ ifeq ($(PKG_PLATFORM),linux) PCFLAGS = -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 diff --git a/ltp/Makefile b/ltp/Makefile index bf82330ad..9c0ba1efb 100644 --- a/ltp/Makefile +++ b/ltp/Makefile @@ -12,6 +12,13 @@ LDIRT = $(TARGETS) LCFLAGS = -DXFS IFLAG = -I$(TOPDIR)/src #Used for including $(TOPDIR)/src/global.h +ifeq ($(HAVE_ATTR_LIST), true) +LCFLAGS += -DHAVE_ATTR_LIST +endif +ifeq ($(PKG_PLATFORM),irix) +LCFLAGS += -DHAVE_ATTR_LIST +endif + ifeq ($(HAVE_AIO), true) TARGETS += aio-stress LCFLAGS += -DAIO @@ -20,7 +27,7 @@ endif default: $(TARGETS) -include $(BUILDRULES) +include $(BUILDRULES) LINKTEST = $(LTLINK) $@.c -o $@ $(CFLAGS) $(LDFLAGS) doio: doio.c $(LIBTEST) diff --git a/ltp/fsstress.c b/ltp/fsstress.c index 27e27e59a..13a6315b3 100644 --- a/ltp/fsstress.c +++ b/ltp/fsstress.c @@ -21,15 +21,19 @@ #ifdef HAVE_ATTR_XATTR_H #include #endif +#ifdef HAVE_ATTR_ATTRIBUTES_H +#include +#endif + +#ifndef HAVE_ATTR_LIST +#define attr_list(path, buf, size, flags, cursor) (errno = -ENOSYS, -1) +#endif #include #define XFS_ERRTAG_MAX 17 -#define XFS_IDMODULO_MAX 32 -#define XFS_PROJIDMODULO_MAX 16 +#define XFS_IDMODULO_MAX 31 /* user/group IDs (1 << x) */ +#define XFS_PROJIDMODULO_MAX 16 /* project IDs (1 << x) */ -/* was (getpagesize()*32) BUT want it to be same - * on all platforms - */ #define FILELEN_MAX (32*4096) typedef enum { @@ -208,11 +212,7 @@ int verbose = 0; void add_to_flist(int, int, int); void append_pathname(pathname_t *, char *); -#ifdef HAVE_LIBATTR -int attr_list_path(pathname_t *, char *, const int, int); -#else int attr_list_path(pathname_t *, char *, const int, int, attrlist_cursor_t *); -#endif int attr_remove_path(pathname_t *, const char *, int); int attr_set_path(pathname_t *, const char *, const char *, const int, int); void check_cwd(void); @@ -343,13 +343,13 @@ int main(int argc, char **argv) exit(1); } } - + if (!dirname) { /* no directory specified */ if (!nousage) usage(); exit(1); } - + (void)mkdir(dirname, 0777); if (chdir(dirname) < 0) { perror(dirname); @@ -474,37 +474,24 @@ int attr_list_path(pathname_t *name, char *buffer, const int buffersize, - int flags -#ifndef HAVE_LIBATTR - , attrlist_cursor_t *cursor -#endif - ) + int flags, + attrlist_cursor_t *cursor) { char buf[MAXNAMELEN]; pathname_t newname; int rval; -#ifdef ATTR_DONTFOLLOW if (flags != ATTR_DONTFOLLOW) { errno = EINVAL; return -1; } -#endif -#ifdef HAVE_LIBATTR - rval = llistxattr(name->path, buffer, buffersize); -#else rval = attr_list(name->path, buffer, buffersize, flags, cursor); -#endif if (rval >= 0 || errno != ENAMETOOLONG) return rval; separate_pathname(name, buf, &newname); if (chdir(buf) == 0) { -#ifdef HAVE_LIBATTR - rval = attr_list_path(&newname, buffer, buffersize, flags); -#else rval = attr_list_path(&newname, buffer, buffersize, flags, cursor); -#endif chdir(".."); } free_pathname(&newname); @@ -1462,9 +1449,7 @@ attr_remove_f(int opno, long r) attrlist_t *alist; char *aname; char buf[4096]; -#ifndef HAVE_LIBATTR attrlist_cursor_t cursor; -#endif int e; int ent; pathname_t f; @@ -1476,16 +1461,10 @@ attr_remove_f(int opno, long r) if (!get_fname(FT_ANYm, r, &f, NULL, NULL, &v)) append_pathname(&f, "."); total = 0; -#ifndef HAVE_LIBATTR bzero(&cursor, sizeof(cursor)); -#endif do { bzero(buf, sizeof(buf)); -#ifdef HAVE_LIBATTR - e = attr_list_path(&f, buf, sizeof(buf), ATTR_DONTFOLLOW); -#else e = attr_list_path(&f, buf, sizeof(buf), ATTR_DONTFOLLOW, &cursor); -#endif check_cwd(); if (e) break; @@ -1500,18 +1479,12 @@ attr_remove_f(int opno, long r) return; } which = (int)(random() % total); -#ifndef HAVE_LIBATTR bzero(&cursor, sizeof(cursor)); -#endif ent = 0; aname = NULL; do { bzero(buf, sizeof(buf)); -#ifdef HAVE_LIBATTR - e = attr_list_path(&f, buf, sizeof(buf), ATTR_DONTFOLLOW); -#else e = attr_list_path(&f, buf, sizeof(buf), ATTR_DONTFOLLOW, &cursor); -#endif check_cwd(); if (e) break; @@ -1527,7 +1500,7 @@ attr_remove_f(int opno, long r) if (aname == NULL) { if (v) printf( - "%d/%d: attr_remove - name %d not found at %s\n", + "%d/%d: attr_remove - name %d not found at %s\n", procid, opno, which, f.path); free_pathname(&f); return; @@ -1588,7 +1561,7 @@ bulkstat_f(int opno, long r) t = malloc(nent * sizeof(*t)); fd = open(".", O_RDONLY); total = 0; - + bsr.lastip=&last; bsr.icount=nent; bsr.ubuffer=t; @@ -1701,10 +1674,12 @@ setxattr_f(int opno, long r) e = fd < 0 ? errno : 0; check_cwd(); - p = (uid_t)random(); + /* project ID */ + p = (uint)random(); e = MIN(idmodulo, XFS_PROJIDMODULO_MAX); nbits = (int)(random() % e); p &= (1 << nbits) - 1; + if ((e = xfsctl(f.path, fd, XFS_IOC_FSGETXATTR, &fsx)) == 0) { fsx.fsx_projid = p; e = xfsctl(f.path, fd, XFS_IOC_FSSETXATTR, &fsx); @@ -1736,9 +1711,12 @@ creat_f(int opno, long r) else parid = fep->id; init_pathname(&f); - type = rtpct ? ((random() % 100) > rtpct ? FT_REG : FT_RTF) : FT_REG; - if (type == FT_RTF) + e1 = (random() % 100); + type = rtpct ? ((e1 > rtpct) ? FT_REG : FT_RTF) : FT_REG; + if (type == FT_RTF) /* rt always gets an extsize */ extsize = (random() % 10) + 1; + else if (e1 < 10) /* one-in-ten get an extsize */ + extsize = random() % 1024; else extsize = 0; e = generate_fname(fep, type, &f, &id, &v); @@ -1759,9 +1737,14 @@ creat_f(int opno, long r) if (fd >= 0) { if (extsize && xfsctl(f.path, fd, XFS_IOC_FSGETXATTR, &a) >= 0) { - a.fsx_xflags |= XFS_XFLAG_REALTIME; - a.fsx_extsize = - geom.rtextsize * geom.blocksize * extsize; + if (type == FT_RTF) { + a.fsx_xflags |= XFS_XFLAG_REALTIME; + a.fsx_extsize = extsize * + geom.rtextsize * geom.blocksize; + } else if (extsize) { + a.fsx_xflags |= XFS_XFLAG_EXTSIZE; + a.fsx_extsize = extsize * geom.blocksize; + } if (xfsctl(f.path, fd, XFS_IOC_FSSETXATTR, &a) < 0) e1 = errno; } diff --git a/m4/package_attrdev.m4 b/m4/package_attrdev.m4 index 677499fe6..70a3ab62a 100644 --- a/m4/package_attrdev.m4 +++ b/m4/package_attrdev.m4 @@ -32,6 +32,11 @@ AC_DEFUN([AC_PACKAGE_NEED_ATTRIBUTES_H], fi ]) +AC_DEFUN([AC_PACKAGE_WANT_ATTRLIST_LIBATTR], + [ AC_CHECK_LIB(attr, attr_list, [have_attr_list=true], [have_attr_list=false]) + AC_SUBST(have_attr_list) + ]) + AC_DEFUN([AC_PACKAGE_NEED_GETXATTR_LIBATTR], [ AC_CHECK_LIB(attr, getxattr,, [ echo diff --git a/tools/auto-qa b/tools/auto-qa index 2d7dcd703..2cd84d863 100755 --- a/tools/auto-qa +++ b/tools/auto-qa @@ -187,7 +187,7 @@ _test_mount() TEST_OPTIONS="$TEST_OPTIONS -ortdev=$TEST_RTDEV" [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_LOGDEV" ] && \ TEST_OPTIONS="$TEST_OPTIONS -ologdev=$TEST_LOGDEV" - _sudo mount -t xfs $TEST_OPTIONS $* $TEST_DEV $TEST_DIR + _sudo mount -t xfs $TEST_OPTIONS $MOUNT_OPTIONS $* $TEST_DEV $TEST_DIR } _i386_install() diff --git a/tools/srcdiff b/tools/srcdiff index 256f2489c..9840e466c 100755 --- a/tools/srcdiff +++ b/tools/srcdiff @@ -80,6 +80,9 @@ sub straightdiff { } elsif ($? != 0) { printf("\t%-35s ... FAILED\n(%s/%s differs to %s/%s)\n", $file, $prefix1, $file, $prefix2, $file); + if (defined($xdiff)) { + `$xdiff $prefix1/$file $prefix2/$file`; + } } }