block sizes.
_populate_scratch()
{
- mkfs -t xfs -f $SCRATCH_DEV >/dev/null 2>&1
+ mkfs_xfs -f $SCRATCH_DEV >/dev/null 2>&1
mount -t xfs $SCRATCH_DEV $SCRATCH_MNT
dd if=/dev/zero of=$SCRATCH_MNT/foo count=200 bs=4096 >/dev/null 2>&1 &
dd if=/dev/zero of=$SCRATCH_MNT/goo count=400 bs=4096 >/dev/null 2>&1 &
_init()
{
echo "*** mkfs"
- if ! mkfs -t xfs -f $SCRATCH_DEV >$tmp.out 2>&1
+ if ! mkfs_xfs -f $SCRATCH_DEV >$tmp.out 2>&1
then
cat $tmp.out
echo "failed to mkfs $SCRATCH_DEV"
# real QA test starts here
_require_scratch
-mkfs -t xfs -f -d size=50m $SCRATCH_DEV >/dev/null
+mkfs_xfs -f -d size=50m $SCRATCH_DEV >/dev/null
mount -t xfs $SCRATCH_DEV $SCRATCH_MNT
out=$SCRATCH_MNT/fillup.$$
rm -f $seq.full
echo "*** reset partition"
$here/src/devzero -b 2048 -n 50 -v 198 $SCRATCH_DEV
echo "*** mkfs"
- if ! mkfs -t xfs -f -d size=50m -l size=512b $SCRATCH_DEV >$tmp.out 2>&1
+ if ! mkfs_xfs -f -d size=50m -l size=512b $SCRATCH_DEV >$tmp.out 2>&1
then
cat $tmp.out
echo "failed to mkfs $SCRATCH_DEV"
umount $SCRATCH_DEV >/dev/null 2>&1
echo "*** MKFS ***" >>$seq.full
echo "" >>$seq.full
-mkfs -t xfs -f $SCRATCH_DEV >>$seq.full 2>&1 \
+mkfs_xfs -f $SCRATCH_DEV >>$seq.full 2>&1 \
|| _fail "mkfs failed"
mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$seq.full 2>&1 \
|| _fail "mount failed"
umount $SCRATCH_DEV >/dev/null 2>&1
_full "mkfs"
-mkfs -t xfs -f -lsize=2000b $SCRATCH_DEV >>$seq.full 2>&1 \
+mkfs_xfs -f -lsize=2000b $SCRATCH_DEV >>$seq.full 2>&1 \
|| _fail "mkfs failed"
_full " mount"
mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$seq.full 2>&1 \
umount $SCRATCH_DEV >/dev/null 2>&1
_full "mkfs"
- mkfs -t xfs -f $VERSION -p $protofile $SCRATCH_DEV >>$seqfull 2>&1 \
+ mkfs_xfs -f $VERSION -p $protofile $SCRATCH_DEV >>$seqfull 2>&1 \
|| _fail "mkfs failed"
echo "*** check FS"
rm -f $seq.full
umount $SCRATCH_DEV >/dev/null 2>&1
-mkfs -t xfs -f $SCRATCH_DEV >/dev/null \
+mkfs_xfs -f $SCRATCH_DEV >/dev/null \
|| _fail "mkfs failed"
echo "*** mount FS"
_require_scratch
echo
-mkfs -t xfs -f $mkfs_args $SCRATCH_DEV | _filter_mkfs 2>/dev/null
+mkfs_xfs -f $mkfs_args $SCRATCH_DEV | _filter_mkfs 2>/dev/null
echo
xfs_logprint $logp_args $SCRATCH_DEV | _filter_logprint
# superblock (hanging around from earlier tests)...
#
size="-d size=100m"
-mkfs -t xfs -f $size $SCRATCH_DEV >/dev/null 2>&1
+mkfs_xfs -f $size $SCRATCH_DEV >/dev/null 2>&1
if [ $? -ne 0 ] # probably don't have a big enough scratch
then
_notrun "SCRATCH_DEV too small, results would be non-deterministic"
# now kick off the real repair test...
#
-mkfs -t xfs -f $size $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
+mkfs_xfs -f $size $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
source $tmp.mkfs
_check_ag 0
_check_ag -1
#
_require_scratch
-MKFSV1="-t xfs -f -p $tmp.proto -n version=1 $SCRATCH_DEV"
-MKFSV2="-t xfs -f -p $tmp.proto -n version=2 $SCRATCH_DEV"
+MKFSV1="-f -p $tmp.proto -n version=1 $SCRATCH_DEV"
+MKFSV2="-f -p $tmp.proto -n version=2 $SCRATCH_DEV"
# sanity test - default + one root directory entry
_create_proto 0
echo "=== version 1, one entry"
-mkfs $MKFSV1 | _filter_mkfs >/dev/null 2>&1
+mkfs_xfs $MKFSV1 | _filter_mkfs >/dev/null 2>&1
_check_repair
echo "=== version 2, one entry (shortform)"
mkfs $MKFSV2 | _filter_mkfs >/dev/null 2>&1
# next, ensure we don't overwrite it
echo "=== Attempting XFS overwrite of $fs..." >>$seq.full
- mkfs -t xfs $SCRATCH_DEV >>$seq.full 2>&1
+ mkfs_xfs $SCRATCH_DEV >>$seq.full 2>&1
[ $? -eq 0 ] && echo "Failed - overwrote fs type ${fs}!"
done
_require_scratch
# devzero blows away 512byte blocks, so make 512byte inodes
-mkfs -t xfs -f -i size=512 $SCRATCH_DEV | _filter_mkfs 2>/dev/null
+mkfs_xfs -f -i size=512 $SCRATCH_DEV | _filter_mkfs 2>/dev/null
`xfs_db -r -c sb -c p $SCRATCH_DEV | grep 'ino = ' | \
sed -e 's/ //g' -e 's/^/export /'`
umount $SCRATCH_DEV >/dev/null 2>&1
echo "*** MKFS ***" >>$seq.full
echo "" >>$seq.full
-mkfs -t xfs -f $SCRATCH_DEV >>$seq.full 2>&1 \
+mkfs_xfs -f $SCRATCH_DEV >>$seq.full 2>&1 \
|| _fail "mkfs failed"
mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$seq.full 2>&1 \
|| _fail "mount failed"
#agsize=16
agsize=32
echo -n "Make $agsize megabyte filesystem on SCRATCH_DEV and mount... "
-_do "mkfs -t xfs -d size=${agsize}m,agcount=1 -l internal -f $SCRATCH_DEV"
+_do "mkfs_xfs -d size=${agsize}m,agcount=1 -l internal -f $SCRATCH_DEV"
_do "mount -t xfs $SCRATCH_DEV $SCRATCH_MNT"
echo "done"
_do_die_on_error=message_only
echo -n "Make a 48 megabyte filesystem on SCRATCH_DEV and mount... "
-_do "mkfs -t xfs -d size=48m,agcount=3 -l internal -f $SCRATCH_DEV"
+_do "mkfs_xfs -d size=48m,agcount=3 -l internal -f $SCRATCH_DEV"
_do "$mnt_cmd"
echo "done"
echo -e -n "\n\r*** XFS QA 044 - expect mount failure messages\n\r\n\r" >/dev/console
echo "*** mkfs"
-mkfs -t xfs -f -l logdev=$SCRATCH_LOGDEV,size=4096b $SCRATCH_DEV | _filter_mkfs 2>/dev/null
+mkfs_xfs -f -l logdev=$SCRATCH_LOGDEV,size=4096b $SCRATCH_DEV | _filter_mkfs 2>/dev/null
_check_mount
_check_require_logdev
echo "*** get uuid"
uuid=`_get_uuid $TEST_DEV`
echo "*** mkfs"
-if ! mkfs -t xfs -f $SCRATCH_DEV >$tmp.out 2>&1
+if ! mkfs_xfs -f $SCRATCH_DEV >$tmp.out 2>&1
then
cat $tmp.out
echo "!!! failed to mkfs on $SCRATCH_DEV"
|| _fail "!!! failed to mount"
_log "Create xfs fs in file on scratch"
-mkfs -t xfs -d file,name=$SCRATCH_MNT/test.xfs,size=20m >> $seq.full 2>&1 \
+mkfs_xfs -d file,name=$SCRATCH_MNT/test.xfs,size=20m >> $seq.full 2>&1 \
|| _fail "!!! failed to mkfs xfs"
_log "Make mount points"
fi
# real QA test starts here
-mkfs -t xfs -f $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
+mkfs_xfs -f $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
cat $tmp.mkfs >>$seq.full
# keep the blocksize and data size for dd later
fi
# real QA test starts here
-mkfs -t xfs -f $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
+mkfs_xfs -f $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
cat $tmp.mkfs >>$seq.full
chmod a+w $seq.full # arbitrary users will write here
# make filesystem on scratch using the defaults
_do 'make filesystem on $SCRATCH_DEV' \
- 'mkfs -t xfs -f $SCRATCH_DEV'
+ 'mkfs_xfs -f $SCRATCH_DEV'
_do 'mount filesytem' \
'mount -t xfs $SCRATCH_DEV $SCRATCH_MNT'
_exercise()
{
- mkfs -t xfs -f $SCRATCH_DEV >/dev/null 2>&1
+ mkfs_xfs -f $SCRATCH_DEV >/dev/null 2>&1
_qmount
umask 022
}
# real QA test starts here
-mkfs -t xfs -f $SCRATCH_DEV >/dev/null 2>&1
+mkfs_xfs -f $SCRATCH_DEV >/dev/null 2>&1
MOUNT_OPTIONS="-o usrquota,grpquota"; export MOUNT_OPTIONS
_qmount
if src/feature -G $SCRATCH_DEV ; then
rm -f $tmp.backup1 $tmp.backup2 $seq.full
# real QA test starts here
-mkfs -t xfs -f $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
+mkfs_xfs -f $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
mount -t xfs $SCRATCH_DEV $SCRATCH_MNT || _fail "mount failed"
_create_test_bed
[ -f check.time ] || touch check.time
+if [ ! -z "$MKFS_OPTIONS" ]
+then
+ echo "check: \$MKFS_OPTIONS specified - \"$MKFS_OPTIONS\""
+ umount $SCRATCH_DEV 2>/dev/null
+ # call the overridden mkfs.xfs - make sure the FS is built
+ # the same as we'll create it later.
+ if ! mkfs_xfs -f $SCRATCH_DEV >$tmp.err 2>&1
+ then
+ echo "our local mkfs_xfs routine ..."
+ cat $tmp.err
+ echo "check: failed to mkfs.xfs \$SCRATCH_DEV using specified options"
+ exit 1
+ fi
+fi
+
if [ ! -z "$MOUNT_OPTIONS" ]
then
echo "check: \$MOUNT_OPTIONS specified - \"$MOUNT_OPTIONS\""
# the same as we'll set it later.
if ! mount -t xfs $TEST_DEV $TEST_DIR >$tmp.err 2>&1
then
- echo "our mount ..."
+ echo "our local mount routine ..."
cat $tmp.err
# call the normal mount
echo "normal mount ..."
{
_require_scratch
- mkfs -t xfs $MKFS_OPTS $SCRATCH_DEV>>$seq.full ||\
+ mkfs_xfs $MKFS_OPTS $SCRATCH_DEV>>$seq.full ||\
_error "mkfs failed"
mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$seq.full ||\
export AWK_PROG PS_HAVE_BSD PS_ALL_FLAGS PLATFORM
-# we override mount so we can specify mount options
+# we override mount and mkfs.xfs so we can specify extra options
mount()
{
esac
}
+mkfs_xfs()
+{
+ /sbin/mkfs.xfs $* $MKFS_OPTIONS
+}
+
#
_get_pids_by_name()
fi
-# check for some required biunaries on our $PATH
+# check for some required binaries on our $PATH
#
for exec in mkfs.xfs xfs_logprint xfs_check xfs_repair xfs_db
do
_log " *** clean scratch device"
-mkfs -t xfs -f $SCRATCH_DEV 2>&1 | _fix_malloc >>$FULL \
+mkfs_xfs -f $SCRATCH_DEV 2>&1 | _fix_malloc >>$FULL \
|| _fail " !!! failed to mkfs SCRATCH_DEV"
pass=1
* using IRIX semantics or Linux semantics
*/
+#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
*/
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include <time.h>
#include <sys/stat.h>
#include <sys/sysmacros.h>