2 #-----------------------------------------------------------------------
3 # Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19 # Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
20 # Mountain View, CA 94043, USA, or: http://www.sgi.com
21 #-----------------------------------------------------------------------
25 if [ "$HOSTOS" == "Linux" ]
27 command dd --help | grep noxfer > /dev/null 2>&1
31 command dd status=noxfer $@
44 export MOUNT_OPTIONS=$XFS_MOUNT_OPTIONS
47 export MOUNT_OPTIONS=$UDF_MOUNT_OPTIONS
50 export MOUNT_OPTIONS=$NFS_MOUNT_OPTIONS
61 export MKFS_OPTIONS=$XFS_MKFS_OPTIONS
64 [ ! -z "$udf_fsize" ] && \
65 UDF_MKFS_OPTIONS="$UDF_MKFS_OPTIONS -s $udf_fsize"
66 export MKFS_OPTIONS=$UDF_MKFS_OPTIONS
69 export MKFS_OPTIONS=$NFS_MKFS_OPTIONS
76 [ -z "$FSTYP" ] && FSTYP=xfs
77 [ -z "$MOUNT_OPTIONS" ] && _mount_opts
78 [ -z "$MKFS_OPTIONS" ] && _mkfs_opts
81 # we need common.config
82 if ! . ./common.config
84 echo "$iam: failed to source common.config"
88 # make sure we have a standard umask
101 if [ $FSTYP != "xfs" ]; then
107 [ "$HOSTOS" != "IRIX" ] && SCRATCH_OPTIONS="$SCRATCH_OPTIONS -f"
116 [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ] && \
117 SCRATCH_OPTIONS="$SCRATCH_OPTIONS ${rt_opt}rtdev=$SCRATCH_RTDEV"
118 [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
119 SCRATCH_OPTIONS="$SCRATCH_OPTIONS ${log_opt}logdev=$SCRATCH_LOGDEV"
127 if [ $FSTYP != "xfs" ]; then
141 [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_RTDEV" ] && \
142 TEST_OPTIONS="$TEST_OPTIONS ${rt_opt}rtdev=$TEST_RTDEV"
143 [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_LOGDEV" ] && \
144 TEST_OPTIONS="$TEST_OPTIONS ${log_opt}logdev=$TEST_LOGDEV"
147 _scratch_mount_options()
149 _scratch_options mount
150 echo $SCRATCH_OPTIONS $MOUNT_OPTIONS $* $SCRATCH_DEV $SCRATCH_MNT
155 _mount -t $FSTYP `_scratch_mount_options $*`
161 _mount -t $FSTYP $TEST_OPTIONS $MOUNT_OPTIONS $* $TEST_DEV $TEST_DIR
164 _scratch_mkfs_options()
166 _scratch_options mkfs
167 echo $SCRATCH_OPTIONS $MKFS_OPTIONS $* $SCRATCH_DEV
172 _scratch_options mkfs
174 $MKFS_XFS_PROG $SCRATCH_OPTIONS $MKFS_OPTIONS $* $SCRATCH_DEV
177 if [ "$USE_BIG_LOOPFS" = yes ]; then
178 [ -z "$RETAIN_AG_BYTES" ] && RETAIN_AG_BYTES=0
179 ./tools/ag-wipe -q -r $RETAIN_AG_BYTES $SCRATCH_DEV
195 $MKFS_UDF_PROG $MKFS_OPTIONS $* $SCRATCH_DEV > /dev/null
198 /sbin/mkfs -t $FSTYP -- $MKFS_OPTIONS $* $SCRATCH_DEV > /dev/null
203 _scratch_xfs_db_options()
206 [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
207 SCRATCH_OPTIONS="-l$SCRATCH_LOGDEV"
208 echo $SCRATCH_OPTIONS $* $SCRATCH_DEV
211 _scratch_xfs_logprint()
214 [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
215 SCRATCH_OPTIONS="-l$SCRATCH_LOGDEV"
216 $XFS_LOGPRINT_PROG $SCRATCH_OPTIONS $* $SCRATCH_DEV
219 _scratch_xfs_repair()
222 [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
223 SCRATCH_OPTIONS="-l$SCRATCH_LOGDEV"
224 [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ] && \
225 SCRATCH_OPTIONS=$SCRATCH_OPTIONS" -r$SCRATCH_RTDEV"
226 [ "$USE_BIG_LOOPFS" = yes ] && SCRATCH_OPTIONS=$SCRATCH_OPTIONS" -t"
227 $XFS_REPAIR_PROG $SCRATCH_OPTIONS $* $SCRATCH_DEV
234 echo "Usage: _get_pids_by_name process-name" 1>&2
238 # Algorithm ... all ps(1) variants have a time of the form MM:SS or
239 # HH:MM:SS before the psargs field, use this as the search anchor.
241 # Matches with $1 (process-name) occur if the first psarg is $1
242 # or ends in /$1 ... the matching uses sed's regular expressions,
243 # so passing a regex into $1 will work.
251 -e "/[0-9]:[0-9][0-9] *[^ ]*\/$1 /s/ .*//p" \
252 -e "/[0-9]:[0-9][0-9] *$1 /s/ .*//p"
260 $NSLOOKUP_PROG $host | $AWK_PROG '{ if ($1 == "Name:") print $2 }'
263 # fix malloc libs output
267 # filter out the Electric Fence notice
270 if (defined $o && /^\s+Electric Fence/) {
276 print $o if (defined $o);
280 print $o if (defined $o);
284 # check if run as root
288 id=`id | $SED_PROG -e 's/(.*//' -e 's/.*=//'`
291 echo "Arrgh ... you need to be root (not uid=$id) to run this test"
298 # _df_device : get an IRIX style df line for a given device
300 # - returns "" if not mounted
301 # - returns fs type in field two (ala IRIX)
302 # - joins line together if split by fancy df formatting
303 # - strips header etc
310 echo "Usage: _df_device device" 1>&2
314 $DF_PROG 2>/dev/null | $AWK_PROG -v what=$1 '
315 match($1,what) && NF==1 {
329 # _df_dir : get an IRIX style df line for device where a directory resides
331 # - returns fs type in field two (ala IRIX)
332 # - joins line together if split by fancy df formatting
333 # - strips header etc
340 echo "Usage: _df_dir device" 1>&2
344 $DF_PROG $1 2>/dev/null | $AWK_PROG -v what=$1 '
360 # return percentage used disk space for mounted device
366 echo "Usage: _used device" 1>&2
370 _df_device $1 | $AWK_PROG '{ sub("%", "") ; print $6 }'
373 # return the FS type of a mounted device
379 echo "Usage: _fs_type device" 1>&2
383 _df_device $1 | $AWK_PROG '{ print $2 }'
386 # return the FS mount options of a mounted device
388 # should write a version which just parses the output of mount for IRIX
389 # compatibility, but since this isn't used at all, at the moment I'll leave
396 echo "Usage: _fs_options device" 1>&2
400 $AWK_PROG -v dev=$1 '
401 match($1,dev) { print $4 }
405 # returns device number if a file is a block device
411 echo "Usage: _is_block_dev dev" 1>&2
415 [ -b $1 ] && src/lstat64 $1 | $AWK_PROG '/Device type:/ { print $9 }'
418 # Do a command, log it to $seq.full, optionally test return status
419 # and die if command fails. If called with one argument _do executes the
420 # command, logs it, and returns its exit status. With two arguments _do
421 # first prints the message passed in the first argument, and then "done"
422 # or "fail" depending on the return status of the command passed in the
423 # second argument. If the command fails and the variable _do_die_on_error
424 # is set to "always" or the two argument form is used and _do_die_on_error
425 # is set to "message_only" _do will print an error message to
430 if [ $# -eq 1 ]; then
432 elif [ $# -eq 2 ]; then
437 echo "Usage: _do [note] cmd" 1>&2
441 (eval "echo '---' \"$_cmd\"") >>$here/$seq.full
442 (eval "$_cmd") >$tmp._out 2>&1; ret=$?
443 cat $tmp._out | _fix_malloc >>$here/$seq.full
444 if [ $# -eq 2 ]; then
445 if [ $ret -eq 0 ]; then
452 && [ "$_do_die_on_error" = "always" \
453 -o \( $# -eq 2 -a "$_do_die_on_error" = "message_only" \) ]
456 eval "echo \"$_cmd\" failed \(returned $ret\): see $seq.full"
463 # bail out, setting up .notrun file
467 echo "$*" >$seq.notrun
468 echo "$seq not run: $*"
473 # just plain bail out
477 echo "$*" | tee -a $here/$seq.full
478 echo "(see $seq.full for details)"
483 # tests whether $FSTYP is one of the supported filesystems for a test
489 if [ "$f" = "$FSTYP" ]
495 _notrun "not suitable for this filesystem type: $FSTYP"
498 # tests whether $FSTYP is one of the supported OSes for a test
504 if [ "$h" = "$HOSTOS" ]
510 _notrun "not suitable for this OS: $HOSTOS"
513 # this test needs a scratch partition - check we're ok & unmount it
519 if [ -z "$SCRATCH_DEV" -o "`_is_block_dev $SCRATCH_DEV`" = "" ]
521 _notrun "this test requires a valid \$SCRATCH_DEV"
523 if [ "`_is_block_dev $SCRATCH_DEV`" = "`_is_block_dev $TEST_DEV`" ]
525 _notrun "this test requires a valid \$SCRATCH_DEV"
528 nfs*|ext2|ext3|reiserfs)
529 echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
530 if [ ! -z "$SCRATCH_DEV" -a ! -b "$SCRATCH_DEV" -a "$?" != "0" ]
532 _notrun "this test requires a valid \$SCRATCH_DEV"
536 _notrun "\$FSTYP ($FSTYP) unknown or not specified"
541 if _mount | grep -q $SCRATCH_DEV
543 # if it's mounted, make sure its on $SCRATCH_MNT
544 if ! _mount | grep $SCRATCH_DEV | grep -q $SCRATCH_MNT
546 echo "\$SCRATCH_DEV is mounted but not on \$SCRATCH_MNT - aborting"
549 # and then unmount it
550 if ! $UMOUNT_PROG $SCRATCH_DEV
552 echo "failed to unmount $SCRATCH_DEV"
558 # this test needs a logdev
562 [ -z "$SCRATCH_LOGDEV" -o ! -b "$SCRATCH_LOGDEV" ] && \
563 _notrun "This test requires a valid \$SCRATCH_LOGDEV"
564 [ "$USE_EXTERNAL" != yes ] && \
565 _notrun "This test requires USE_EXTERNAL to be enabled"
567 # ensure its not mounted
568 $UMOUNT_PROG $SCRATCH_LOGDEV 2>/dev/null
571 # this test requires loopback device support
575 if [ "$HOSTOS" != "Linux" ]
577 _notrun "This test requires linux for loopback device support"
580 modprobe loop >/dev/null 2>&1
581 if grep loop /proc/devices >/dev/null 2>&1
585 _notrun "This test requires loopback device support"
589 # this test requires that (large) loopback device files are not in use
591 _require_nobigloopfs()
593 [ "$USE_BIG_LOOPFS" = yes ] && \
594 _notrun "Large filesystem testing in progress, skipped this test"
597 # this test requires that a realtime subvolume is in use, and
598 # that the kernel supports realtime as well.
602 [ "$USE_EXTERNAL" = yes ] || \
603 _notrun "External volumes not in use, skipped this test"
604 [ "$SCRATCH_RTDEV" = "" ] && \
605 _notrun "Realtime device required, skipped this test"
608 # this test requires that a specified command (executable) exists
612 [ -x "$1" ] || _notrun "$1 utility required, skipped this test"
615 # this test requires that external log/realtime devices are not in use
617 _require_nonexternal()
619 [ "$USE_EXTERNAL" = yes ] && \
620 _notrun "External device testing in progress, skipped this test"
623 # check that a FS is mounted as XFS. if so, return mount point
629 echo "Usage: _xfs_mounted device" 1>&2
635 if _mount | grep $device | $AWK_PROG '
636 /type xfs/ { print $3 ; exit 0 }
640 echo "_xfs_mounted: $device is not a mounted XFS FS"
646 # remount a FS to a new mode (ro or rw)
652 echo "Usage: _remount device ro/rw" 1>&2
658 if ! mount -o remount,$mode $device
660 echo "_remount: failed to remount filesystem on $device as $mode"
665 # run xfs_check and friends on a FS.
667 # if the filesystem is mounted, it's either remounted ro before being
668 # checked or it's unmounted and then remounted
673 _check_xfs_filesystem()
677 echo "Usage: _check_xfs_filesystem device <logdev>|none <rtdev>|none" 1>&2
682 if [ "$2" != "none" ]; then
683 extra_log_options="-l$2"
684 extra_mount_options="-ologdev=$2"
687 if [ "$3" != "none" ]; then
688 extra_rt_options="-r$3"
689 extra_mount_options=$extra_mount_options" -ortdev=$3"
691 extra_mount_options=$extra_mount_options" $MOUNT_OPTIONS"
693 [ "$FSTYP" != xfs ] && return 0
695 [ "$USE_BIG_LOOPFS" = yes ] && testoption=-t
697 type=`_fs_type $device`
700 if [ "$type" = "xfs" ]
704 if [ $USE_REMOUNT -eq 0 ]
706 mountpoint=`_xfs_mounted $device`
713 $XFS_LOGPRINT_PROG -t $extra_log_options $device 2>&1 \
714 | tee $tmp.logprint | grep -q "<CLEAN>"
715 if [ $? -ne 0 -a "$HOSTOS" = "Linux" ]
717 echo "_check_xfs_filesystem: filesystem on $device has dirty log (see $seq.full)"
719 echo "_check_xfs_filesystem: filesystem on $device has dirty log" >>$here/$seq.full
720 echo "*** xfs_logprint -t output ***" >>$here/$seq.full
721 cat $tmp.logprint >>$here/$seq.full
722 echo "*** end xfs_logprint output" >>$here/$seq.full
727 $XFS_CHECK_PROG $testoption $extra_log_options $device 2>&1 |\
728 _fix_malloc >$tmp.fs_check
729 if [ -s $tmp.fs_check ]
731 echo "_check_xfs_filesystem: filesystem on $device is inconsistent (c) (see $seq.full)"
733 echo "_check_xfs_filesystem: filesystem on $device is inconsistent" >>$here/$seq.full
734 echo "*** xfs_check output ***" >>$here/$seq.full
735 cat $tmp.fs_check >>$here/$seq.full
736 echo "*** end xfs_check output" >>$here/$seq.full
740 # repair doesn't scale massively at this stage, optionally skip it for now
741 [ "$USE_BIG_LOOPFS" = yes ] || \
742 $XFS_REPAIR_PROG -n $extra_log_options $extra_rt_options $device >$tmp.repair 2>&1
745 echo "_check_xfs_filesystem: filesystem on $device is inconsistent (r) (see $seq.full)"
747 echo "_check_xfs_filesystem: filesystem on $device is inconsistent" >>$here/$seq.full
748 echo "*** xfs_repair -n output ***" >>$here/$seq.full
749 cat $tmp.repair | _fix_malloc >>$here/$seq.full
750 echo "*** end xfs_repair output" >>$here/$seq.full
754 rm -f $tmp.fs_check $tmp.logprint $tmp.repair
758 echo "*** mount output ***" >>$here/$seq.full
759 _mount >>$here/$seq.full
760 echo "*** end mount output" >>$here/$seq.full
761 elif [ "$type" = "xfs" ]
764 if [ $USE_REMOUNT -eq 0 ]
766 if ! _mount -t xfs $extra_mount_options $device $mountpoint
768 echo "!!! failed to remount $device on $mountpoint"
776 [ $ok -eq 0 ] && exit 1
780 # Filter the knowen errors the UDF Verifier reports.
781 _udf_test_known_error_filter()
783 egrep -v "PVD 60 Error: Interchange Level: 1, Maximum Interchange Level: 0|FSD 28 Error: Interchange Level: 1, Maximum Interchange Level: 1,|PVD 72 Warning: Volume Set Identifier: \"\*IRIX UDF\",|Warning: [0-9]+ unused blocks NOT marked as unallocated."
787 _check_udf_filesystem()
789 [ "$DISABLE_UDF_TEST" == "1" ] && return
791 if [ $# -ne 1 -a $# -ne 2 ]
793 echo "Usage: _check_udf_filesystem device [last_block]" 1>&2
797 if [ ! -x $here/src/udf_test ]
799 echo "udf_test not installed, please download and build the Philips"
800 echo "UDF Verification Software from http://www.extra.research.philips.com/udf/."
801 echo "Then copy the udf_test binary to $here/src/."
802 echo "If you do not wish to run udf_test then set environment variable DISABLE_UDF_TEST"
810 LAST_BLOCK=`expr \( $2 - 1 \)`
811 OPT_ARG="-lastvalidblock $LAST_BLOCK"
815 sleep 1 # Due to a problem with time stamps in udf_test
816 $here/src/udf_test $OPT_ARG $device | tee $here/$seq.checkfs | egrep "Error|Warning" | \
817 _udf_test_known_error_filter | \
818 egrep -iv "Error count:.*[0-9]+.*total occurrences:.*[0-9]+|Warning count:.*[0-9]+.*total occurrences:.*[0-9]+" | \
819 sed "s/^.*$/Warning UDF Verifier reported errors see $seq.checkfs./g"
827 [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_LOGDEV" ] && \
828 TEST_LOG="$TEST_LOGDEV"
830 [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_RTDEV" ] && \
831 TEST_RT="$TEST_RTDEV"
833 _check_xfs_filesystem $TEST_DEV $TEST_LOG $TEST_RT
835 # check for ipath consistency
836 if $XFS_GROWFS_PROG -n $TEST_DIR | grep -q 'inode-paths=1'; then
837 # errors go to stderr
838 xfs_check_ipaths $TEST_DIR >/dev/null
839 xfs_repair_ipaths -n $TEST_DIR >/dev/null
849 [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
850 SCRATCH_LOG="$SCRATCH_LOGDEV"
852 [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ] && \
853 SCRATCH_RT="$SCRATCH_RTDEV"
855 _check_xfs_filesystem $SCRATCH_DEV $SCRATCH_LOG $SCRATCH_RT
858 _check_udf_filesystem $SCRATCH_DEV $udf_fsize
861 # Don't know how to check an NFS filesystem, yet.
868 _full_fstyp_details()
870 [ -z "$FSTYP" ] && FSTYP=xfs
871 if [ $FSTYP = xfs ]; then
872 if [ -d /proc/fs/xfs ]; then
873 if grep -q 'debug 0' /proc/fs/xfs/stat; then
874 FSTYP="$FSTYP (non-debug)"
875 elif grep -q 'debug 1' /proc/fs/xfs/stat; then
876 FSTYP="$FSTYP (debug)"
879 if uname -a | grep -qi 'debug'; then
880 FSTYP="$FSTYP (debug)"
882 FSTYP="$FSTYP (non-debug)"
889 _full_platform_details()
895 echo "$os/$platform $host $kernel"
910 # Don't know how to check an NFS filesystem, yet.
920 [ "$FSTYP" != "xfs" ] \
921 && _fail "setup_xfs_testdir: \$FSTYP ($FSTYP) is not xfs"
926 _setup_udf_scratchdir()
928 [ "$FSTYP" != "udf" ] \
929 && _fail "setup_udf_testdir: \$FSTYP is not udf"
930 [ -z "$SCRATCH_DEV" -o ! -b "$SCRATCH_DEV" ] \
931 && _notrun "this test requires a valid \$SCRATCH_DEV"
932 [ -z "$SCRATCH_MNT" ] \
933 && _notrun "this test requires a valid \$SCRATCH_MNT"
936 if _mount | grep -q $SCRATCH_DEV
938 # if it's mounted, make sure its on $TEST_RW_DIR
939 if ! _mount | grep $SCRATCH_DEV | grep -q $SCRATCH_MNT
941 _fail "\$SCRATCH_DEV is mounted but not on \$SCRATCH_MNT - aborting"
943 $UMOUNT_PROG $SCRATCH_DEV
952 _setup_nfs_scratchdir()
954 [ "$FSTYP" != "nfs" ] \
955 && _fail "setup_nfs_testdir: \$FSTYP is not nfs"
956 [ -z "$SCRATCH_DEV" ] \
957 && _notrun "this test requires a valid host fs for \$SCRATCH_DEV"
958 [ -z "$SCRATCH_MNT" ] \
959 && _notrun "this test requires a valid \$SCRATCH_MNT"
962 if _mount | grep -q $SCRATCH_DEV
964 # if it's mounted, make sure its on $SCRATCH_MNT
965 if ! _mount | grep $SCRATCH_DEV | grep -q $SCRATCH_MNT
967 _fail "\$SCRATCH_DEV is mounted but not on \$SCRATCH_MNT - aborting"
969 $UMOUNT_PROG $SCRATCH_DEV
979 # Warning for UDF and NFS this function calls _setup_udf_scratchdir and
980 # _setup_udf_scratchdir. This is done because testdir is a persistent
981 # XFS only partition.
990 _setup_udf_scratchdir
993 _setup_nfs_scratchdir
996 _fail "\$FSTYP is not xfs, udf or nfs"
1005 # do nothing, testdir is $TEST_DIR
1009 # umount testdir as it is $SCRATCH_MNT which could be used by xfs next
1010 [ -n "$testdir" ] && $UMOUNT_PROG $testdir
1013 # umount testdir as it is $SCRATCH_MNT which could be used by xfs next
1014 [ -n "$testdir" ] && $UMOUNT_PROG $testdir
1017 _fail "\$FSTYP is not xfs, udf or nfs"
1024 if [ -z "$1" ]; then
1025 echo Error must pass \$seq.
1029 if [ "`uname`" == "IRIX64" ] || [ "`uname`" == "IRIX" ]; then
1031 elif [ "`uname`" == "Linux" ]; then
1034 echo Error test $seq does not run on the operating system: `uname`
1052 if [ $size -gt 0 ]; then
1053 dd if=/dev/zero of=$file bs=1024 count=$size
1059 # takes dirname, depth
1062 dirname=$1; depth=$2
1063 mkdir $dirname || die "mkdir $dirname failed"
1066 _nfiles $files # files for this dir
1068 [ $depth -eq 0 ] && return
1069 deep=`expr $depth - 1` # go 1 down
1071 [ $verbose = true ] && echo "descending, depth from leaves = $deep"
1074 while [ $d -lt $dirs ]
1076 _descend d$d $deep &
1082 # Populate a filesystem with inodes for performance experiments
1084 # usage: populate [-v] [-n ndirs] [-f nfiles] [-d depth] [-r root] [-s size]
1089 dirs=5 # ndirs in each subdir till leaves
1090 size=0 # sizeof files in K
1091 files=100 # num files in _each_ subdir
1092 depth=2 # depth of tree from root to leaves
1094 root=root # path of initial root of directory tree
1096 while getopts "d:f:n:r:s:v" c
1108 _descend $root $depth
1113 [ $verbose = true ] && echo done
1116 # query whether the given file has the given inode flag set
1123 if which $XFS_IO_PROG >/dev/null; then
1124 if $XFS_IO_PROG -r -c 'lsattr -v' "$file" | grep -q "$flag" ; then
1131 # query the given files extsize allocator hint in bytes (if any)
1138 if which $XFS_IO_PROG >/dev/null; then
1139 blocks=`$XFS_IO_PROG -r -c 'stat' "$file" | \
1140 awk '/^xattr.extsize =/ { print $3 }'`
1142 [ -z "$blocks" ] && blocks="0"
1147 ################################################################################
1149 if [ "$iam" != new -a "$iam" != bench ]
1151 # make some further configuration checks here
1153 if [ "$TEST_DEV" = "" ]
1155 echo "common.rc: Error: \$TEST_DEV is not set"
1159 # if $TEST_DEV is not mounted, mount it now as XFS
1160 if [ -z "`_fs_type $TEST_DEV`" ]
1162 # $TEST_DEV is not mounted
1165 echo "common.rc: retrying test device mount with external set"
1166 [ "$USE_EXTERNAL" != "yes" ] && export USE_EXTERNAL=yes
1169 echo "common.rc: could not mount $TEST_DEV on $TEST_DIR"
1175 if [ "`_fs_type $TEST_DEV`" != "$FSTYP" ]
1177 echo "common.rc: Error: \$TEST_DEV ($TEST_DEV) is not a MOUNTED $FSTYP filesystem"
1183 # make sure this script returns success