Merge of master-melb:xfs-cmds:24763a by kenmcd.
_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
#! /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.
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'
_n="$1"
_param="$2"
_count="$3"
-
+
out=$testdir/fsstress.$$.$_n
rm -rf $out
if ! mkdir $out
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
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
# 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
{
count=$1
echo "*** generate log traffic"
-
+
out=$SCRATCH_MNT/$$.tmp
-
+
echo " *** mount"
if ! _scratch_mount
then
# 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
else
expr $lsunit \* $dbsize
fi
-}
+}
_after_log()
{
#! /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.
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
_filter()
{
sed "s#$testdir[^ :]*#<TESTFILE>#g;
- s#$tmp[^ :]*#<TMPFILE>#g;
- s#/proc[^ :]*#<PROCFILE>#g" $1
+ s#$tmp[^ :]*#<TMPFILE>#g" $1
}
_attr()
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
*** print attributes
getfattr: <TESTFILE>: No such file or directory
!!! error return
-*** list non-xfs file (in /proc)
- *** print attributes
-getfattr: <PROCFILE>: Operation not supported
- !!! error return
*** list empty file
*** print attributes
*** query non-existant attribute
# 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
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=""
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
# 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!)
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
|| _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"
_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"
|| _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
# 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);
}
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
_qmount
_repquota -$type $QUOTA_FS | _filter_and_check_blocks
-
# success, all done
status=0
exit
# 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.
#
. ./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 <file>
[ $HOSTOS == Linux ] && LS_BLOCKSIZE="--block-size=512"
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
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
#
;;
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
;;
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
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
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"
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"
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 ""
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
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
_setup_testdir
-$here/ltp/fsstress \
+$FSSTRESS_PROG \
-d $testdir/fsstress \
-f allocsp=0 \
-f freesp=0 \
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
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
|| _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
}
rm -f $seq.full $tmp.*
_require_scratch
-_require_v2log
+_require_v2log
echo "*** init FS"
umount $SCRATCH_DEV >/dev/null 2>&1
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
. ./common.filter
. ./common.log
-#
+#
# filter out counts which will vary
# - blocks, agsize, agcount, device name
# filter out differences between linux and irix:
# 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 | \
-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]* *//' \
exit 1
fi
}
-
+
_fill_scratch()
{
$XFS_IO_PROG -f -c "resvsp 0 ${1}" $SCRATCH_MNT/resvfile
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
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
# 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.
. $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
}
# 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
#! /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.
. $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"
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"
-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
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"
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"
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
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
. ./common.filter
# real QA test starts here
-_supported_fs xfs
+_supported_fs xfs
_supported_os IRIX Linux
_setup_testdir
_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 \
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}
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"
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
;;
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
#/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
#
_restore_debug=-v4
_invutil_debug=-d
fi
-
+
# Use dump/restore in qa directory for debugging
PATH="$here:$PATH"
export PATH
_mt()
{
op=$1
- if _isrmt; then
+ if _isrmt; then
# REMOTE
_rmtdev=`echo $dumptape | $AWK_PROG -F: '{print $2}'`
{
_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
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
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
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
}
#
-# 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
#
# LOCAL
echo "Put scsi tape driver into variable block size mode"
mt -f $dumptape setblk 0
- fi
+ fi
}
_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
_scratch_mount >>$here/$seq.full || _fail "mount failed"
}
-#
+#
# Cleanup created dirs and files
# Called by trap
#
}
#
-# Run fsstress to create a mixture of
+# Run fsstress to create a mixture of
# files,dirs,links,symlinks
#
# Pinched from test 013.
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
cat <<End-of-File >$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
_mk_fillconfig_xattr()
{
cat <<End-of-File >$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
do
if [ $nbytes = "d" ]; then
# create a directory
- dir=$file
+ dir=$file
if [ ! -d $dir ]
then
if mkdir $dir
POSIXLY_CORRECT=yes \
dd if=/dev/zero of=$_largefile bs=1 seek=$_largesize count=10 2>&1
_stable_fs
-}
+}
_create_dumpdir_fill()
{
_mk_fillconfig1
_do_create_dumpdir_fill
_stable_fs
-}
+}
_create_dumpdir_fill2()
{
_mk_fillconfig2
_do_create_dumpdir_fill
_stable_fs
-}
+}
_create_dumpdir_fill_perm()
{
_mk_fillconfig_perm
_do_create_dumpdir_fill
_stable_fs
-}
+}
_create_dumpdir_fill_ea()
{
_mk_fillconfig_ea
_do_create_dumpdir_fill
_stable_fs
-}
+}
#
cat <<End-of-File >$tmp.config
# pathname
#
-small
-sub/big
+small
+sub/big
#
sub/a
sub/c
fi
ln -s $file $file-link
if [ -n "$perms2" ]; then
- umask $omask
+ umask $omask
fi
if [ -n "$owner" -a -n "$group" ]; then
_mk_symlink_config()
{
cat <<End-of-File >$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
_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
}
{ print }
'
-}
+}
-#
+#
# Filter out the non-deterministic dump msgs from
# xfsdump and xfsrestore
#
}
#
-# Note: requires a space between option letter and argument
+# Note: requires a space between option letter and argument
#
_parse_args()
{
in
-f)
[ -z "$2" ] && _fail "missing argument for -f"
- dumptape=$2
+ dumptape=$2
shift
;;
-L)
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
| sed -e "s#$restore_sdir\/##" >$tmp.restore_dir
diff -bcs $tmp.dump_dir $tmp.restore_dir | sed -e "s#$tmp#TMP#g"
-
}
#
#
# 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()
{
{
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
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}'
}
# 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
{
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
}
# 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'
}
#
#
_check_quota_file()
{
- _check_quota 'xfsdump_quotas' 'xfsdump_quotas_group'
+ _check_quota 'xfsdump_quotas' 'xfsdump_quotas_group' 'xfsdump_quotas_proj'
}
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=""
#
_populate_fs()
{
-
here=`pwd`
dirs=5 # ndirs in each subdir till leaves
size=0 # sizeof files in K
esac
done
-
_descend $root $depth
wait
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
+}
+
################################################################################
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
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
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
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
default: $(TARGETS)
-include $(BUILDRULES)
+include $(BUILDRULES)
LINKTEST = $(LTLINK) $@.c -o $@ $(CFLAGS) $(LDFLAGS)
doio: doio.c $(LIBTEST)
#ifdef HAVE_ATTR_XATTR_H
#include <attr/xattr.h>
#endif
+#ifdef HAVE_ATTR_ATTRIBUTES_H
+#include <attr/attributes.h>
+#endif
+
+#ifndef HAVE_ATTR_LIST
+#define attr_list(path, buf, size, flags, cursor) (errno = -ENOSYS, -1)
+#endif
#include <math.h>
#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 {
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);
exit(1);
}
}
-
+
if (!dirname) {
/* no directory specified */
if (!nousage) usage();
exit(1);
}
-
+
(void)mkdir(dirname, 0777);
if (chdir(dirname) < 0) {
perror(dirname);
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);
attrlist_t *alist;
char *aname;
char buf[4096];
-#ifndef HAVE_LIBATTR
attrlist_cursor_t cursor;
-#endif
int e;
int ent;
pathname_t f;
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;
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;
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;
t = malloc(nent * sizeof(*t));
fd = open(".", O_RDONLY);
total = 0;
-
+
bsr.lastip=&last;
bsr.icount=nent;
bsr.ubuffer=t;
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);
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);
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;
}
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
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()
} 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`;
+ }
}
}