_populate_scratch()
{
echo "=== mkfs output ===" >>$seq.full
- mkfs_xfs $SCRATCH_DEV | tee -a $seq.full | _filter_mkfs 2>$tmp.mkfs
+ _scratch_mkfs_xfs | tee -a $seq.full | _filter_mkfs 2>$tmp.mkfs
source $tmp.mkfs
- mount -t xfs $SCRATCH_DEV $SCRATCH_MNT
+ _scratch_mount
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 &
dd if=/dev/zero of=$SCRATCH_MNT/moo count=800 bs=4096 >/dev/null 2>&1 &
wait
umount $SCRATCH_MNT # flush everything
- mount -t xfs $SCRATCH_DEV $SCRATCH_MNT # and then remount
+ _scratch_mount # and then remount
}
_init()
{
echo "*** mkfs"
- if ! mkfs_xfs $SCRATCH_DEV >$tmp.out 2>&1
+ if ! _scratch_mkfs_xfs >$tmp.out 2>&1
then
cat $tmp.out
echo "failed to mkfs $SCRATCH_DEV"
fi
echo "*** mount"
- if ! mount $SCRATCH_DEV $SCRATCH_MNT -t xfs
+ if ! _scratch_mount
then
echo "failed to mount $SCRATCH_DEV"
exit 1
status=1
fi
- _check_fs $TEST_DEV
+ _check_test_fs
}
count=1000
-_check_fs $TEST_DEV
+_check_test_fs
# the default
# real QA test starts here
_require_scratch
-mkfs_xfs -d size=50m $SCRATCH_DEV >/dev/null
-mount -t xfs $SCRATCH_DEV $SCRATCH_MNT
+_scratch_mkfs_xfs -d size=50m >/dev/null
+_scratch_mount
out=$SCRATCH_MNT/fillup.$$
rm -f $seq.full
echo "*** mkfs"
force_opts="-dsize=50m -lsize=2097152"
echo mkfs_xfs $force_opts $SCRATCH_DEV >>$seq.full
- mkfs_xfs $force_opts $SCRATCH_DEV | _filter_mkfs >/dev/null 2>$tmp.mkfs
+ _scratch_mkfs_xfs $force_opts | _filter_mkfs >/dev/null 2>$tmp.mkfs
source $tmp.mkfs
}
out=$SCRATCH_MNT/$$.tmp
echo " *** mount"
- if ! mount -t xfs $SCRATCH_DEV $SCRATCH_MNT
+ if ! _scratch_mount
then
echo "failed to mount $SCRATCH_DEV"
exit 1
_log_size()
{
- xfs_logprint -tb $SCRATCH_DEV | $AWK_PROG '
- /log device/ { print $7}
+ _scratch_xfs_logprint -tb | $AWK_PROG '
+ /log file: / || /log device: / { print $7}
'
}
_log_head()
{
- xfs_logprint -tb $SCRATCH_DEV | $AWK_PROG '
+ _scratch_xfs_logprint -tb | $AWK_PROG '
/head:/ { print $5 }
'
}
}
trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15
-_clean_log()
-{
- echo "" >>$seq.full
- echo "*** xfs_logprint ***" >>$seq.full
- echo "" >>$seq.full
- xfs_logprint -tb $1 | tee -a $seq.full \
- | head | grep -q "<CLEAN>" || _fail "DIRTY LOG"
-}
-
# get standard environment, filters and checks
. ./common.rc
. ./common.filter
umount $SCRATCH_DEV >/dev/null 2>&1
echo "*** MKFS ***" >>$seq.full
echo "" >>$seq.full
-mkfs_xfs $SCRATCH_DEV >>$seq.full 2>&1 \
+_scratch_mkfs_xfs >>$seq.full 2>&1 \
|| _fail "mkfs failed"
-mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$seq.full 2>&1 \
+_scratch_mount >>$seq.full 2>&1 \
|| _fail "mount failed"
echo "*** test"
echo " *** test $l"
src/fsstress -d $SCRATCH_MNT -n 1000 $FSSTRESS_AVOID >>$seq.full
- mount -o remount,ro $SCRATCH_DEV \
+ _scratch_mount -o remount,ro \
|| _fail "remount ro failed"
- _clean_log $SCRATCH_DEV
-
+ echo "" >>$seq.full
+ echo "*** xfs_logprint ***" >>$seq.full
+ echo "" >>$seq.full
+ _scratch_xfs_logprint -tb | tee -a $seq.full \
+ | head | grep -q "<CLEAN>" || _fail "DIRTY LOG"
+
echo "" >>$seq.full
echo "*** XFS_CHECK ***" >>$seq.full
echo "" >>$seq.full
xfs_check $SCRATCH_DEV >>$seq.full 2>&1 \
|| _fail "xfs_check failed"
- mount -o remount,rw $SCRATCH_DEV \
+ _scratch_mount -o remount,rw \
|| _fail "remount rw failed"
done
echo "" >>$seq.full
}
-_clean_log()
-{
- _full "clean_log : xfs_logprint"
- xfs_logprint -t $1 | tee -a $seq.full \
- | head | grep -q "<CLEAN>" || _fail "DIRTY LOG"
-}
-
_filter_logprint()
{
sed '
s/data device: 0x[0-9a-f][0-9a-f]*/data device: <DEVICE>/;
s/log device: 0x[0-9a-f][0-9a-f]*/log device: <DEVICE>/;
+ s/log file: \".*\"/log device: <DEVICE>/;
s/daddr: [0-9][0-9]*/daddr: <DADDR>/;
s/length: [0-9][0-9]*/length: <LENGTH>/;
s/length: [0-9][0-9]*/length: <LENGTH>/;
_check_log()
{
- _clean_log $SCRATCH_DEV
+ _full "clean_log : xfs_logprint"
+ _scratch_xfs_logprint -t | tee -a $seq.full \
+ | head | grep -q "<CLEAN>" || _fail "DIRTY LOG"
echo "### xfs_logprint output ###"
- xfs_logprint $SCRATCH_DEV 2>&1 | _filter_logprint
+ _scratch_xfs_logprint 2>&1 | _filter_logprint
echo "### xfs_logprint -t -i -s 0 output ###"
- xfs_logprint -t -i -s 0 $SCRATCH_DEV 2>&1 | _filter_logprint
+ _scratch_xfs_logprint -t -i -s 0 2>&1 | _filter_logprint
echo "### xfs_logprint -t -b -s 0 output ###"
- xfs_logprint -t -b -s 0 $SCRATCH_DEV 2>&1 | _filter_logprint
+ _scratch_xfs_logprint -t -b -s 0 2>&1 | _filter_logprint
}
# real QA test starts here
umount $SCRATCH_DEV >/dev/null 2>&1
_full "mkfs"
-mkfs_xfs -lsize=2000b $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
+_scratch_mkfs_xfs -lsize=2000b | _filter_mkfs 2>$tmp.mkfs
source $tmp.mkfs
[ $dbsize -eq 4096 ] \
|| _notrun "Logprint test, tailored to 4K blocks ($dbsize in use)"
rm -f $seq.out $seq.full
_full " mount"
-mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$seq.full 2>&1 \
+_scratch_mount >>$seq.full 2>&1 \
|| _fail "mount failed"
_setup_seq_out
umount $SCRATCH_DEV >/dev/null 2>&1
_full "mkfs"
- mkfs_xfs $VERSION -p $protofile $SCRATCH_DEV >>$seqfull 2>&1 \
+ _scratch_mkfs_xfs $VERSION -p $protofile >>$seqfull 2>&1 \
|| _fail "mount failed"
echo "*** check FS"
- _check_fs $SCRATCH_DEV
+ _check_scratch_fs
echo "*** mount FS"
_full " mount"
- mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$seqfull 2>&1 \
+ _scratch_mount >>$seqfull 2>&1 \
|| _fail "mount failed"
echo "*** verify FS"
|| _fail "umount failed"
echo "*** check FS"
- _check_fs $SCRATCH_DEV
+ _check_scratch_fs
}
_verify_fs 1
umount $SCRATCH_DEV >/dev/null 2>&1
echo "*** mkfs"
-mkfs_xfs $SCRATCH_DEV >/dev/null \
+_scratch_mkfs_xfs >/dev/null \
|| _fail "mkfs failed"
echo "*** mount FS"
-mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >/dev/null \
+_scratch_mount >/dev/null \
|| _fail "mount failed"
testfile=$SCRATCH_MNT/testfile
. ./common.rc
. ./common.filter
-mkfs_args=""
-logp_args=""
-if [ ! -z "$SCRATCH_LOGDEV" ] # test external log if possible
-then
- _require_logdev
- mkfs_args="-l logdev=$SCRATCH_LOGDEV,size=1200b"
- logp_args="-l $SCRATCH_LOGDEV"
-fi
-
_filter_logprint()
{
perl -ne '
_require_scratch
echo
-mkfs_xfs $mkfs_args $SCRATCH_DEV | _filter_mkfs 2>/dev/null
+_scratch_mkfs_xfs | _filter_mkfs 2>/dev/null
echo
-xfs_logprint $logp_args $SCRATCH_DEV | _filter_logprint
+_scratch_xfs_logprint | _filter_logprint
status=0
exit
# superblock (hanging around from earlier tests)...
#
-mkfs_xfs $DSIZE $SCRATCH_DEV >/dev/null 2>&1
+_scratch_mkfs_xfs $DSIZE >/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"
else
- mount -t xfs $SCRATCH_DEV $SCRATCH_MNT
+ _scratch_mount
src/feature -U $SCRATCH_DEV && \
_notrun "Quota are enabled, test needs controlled sb recovery"
src/feature -G $SCRATCH_DEV && \
# now kick off the real repair test...
#
-mkfs_xfs $DSIZE $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
+_scratch_mkfs_xfs $DSIZE | _filter_mkfs 2>$tmp.mkfs
source $tmp.mkfs
_check_ag 0
_check_ag -1
resetting superblock realtime bitmap ino pointer to INO
sb realtime summary inode INO inconsistent with calculated value INO
resetting superblock realtime summary ino pointer to INO
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
- zero log...
- scan filesystem freespace and inode maps...
- found root inode chunk
Corrupting agf 0 - setting bits to 0
Wrote X.XXKb (value 0x0)
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
- zero log...
- scan filesystem freespace and inode maps...
bad magic # 0x0 for agf 0
Corrupting agi 0 - setting bits to 0
Wrote X.XXKb (value 0x0)
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
- zero log...
- scan filesystem freespace and inode maps...
bad magic # 0x0 for agi 0
Corrupting agfl 0 - setting bits to 0
Wrote X.XXKb (value 0x0)
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
- zero log...
- scan filesystem freespace and inode maps...
- found root inode chunk
resetting superblock realtime bitmap ino pointer to INO
sb realtime summary inode INO inconsistent with calculated value INO
resetting superblock realtime summary ino pointer to INO
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
- zero log...
- scan filesystem freespace and inode maps...
- found root inode chunk
Corrupting agf 0 - setting bits to -1
Wrote X.XXKb (value 0xffffffff)
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
- zero log...
- scan filesystem freespace and inode maps...
bad magic # 0xffffffff for agf 0
Corrupting agi 0 - setting bits to -1
Wrote X.XXKb (value 0xffffffff)
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
- zero log...
- scan filesystem freespace and inode maps...
bad magic # 0xffffffff for agi 0
Corrupting agfl 0 - setting bits to -1
Wrote X.XXKb (value 0xffffffff)
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
- zero log...
- scan filesystem freespace and inode maps...
- found root inode chunk
_check_repair()
{
- xfs_repair $SCRATCH_DEV >$tmp.0 2>&1
+ _scratch_xfs_repair >$tmp.0 2>&1
for i in 1 2 3 4
do
echo "Repairing, iteration $i" | tee -a $seq.full
- xfs_repair $SCRATCH_DEV 2>&1 | tee -a $seq.full >$tmp.$i
+ _scratch_xfs_repair 2>&1 | tee -a $seq.full >$tmp.$i
diff $tmp.0 $tmp.$i >> $seq.full
if [ $? -ne 0 ]; then
echo "ERROR: repair round $i differs (see $seq.full)"
# echo all interesting stuff...
perl -ne '
s/(rebuilding directory inode) (\d+)/\1 INO/g;
+ s/internal log/<TYPEOF> log/g;
+ s/external log on \S+/<TYPEOF> log/g;
/^\S+/ && print;
' $tmp.$i
done
#
_require_scratch
-MKFSV1="-p $tmp.proto -n version=1 $SCRATCH_DEV"
-MKFSV2="-p $tmp.proto -n version=2 $SCRATCH_DEV"
+MKFSV1="-p $tmp.proto -n version=1"
+MKFSV2="-p $tmp.proto -n version=2"
# sanity test - default + one root directory entry
_create_proto 0
echo "=== version 1, one entry"
-mkfs_xfs $MKFSV1 | _filter_mkfs >/dev/null 2>&1
+_scratch_mkfs_xfs $MKFSV1 | _filter_mkfs >/dev/null 2>&1
_check_repair
echo "=== version 2, one entry (shortform)"
-mkfs_xfs $MKFSV2 | _filter_mkfs >/dev/null 2>&1
+_scratch_mkfs_xfs $MKFSV2 | _filter_mkfs >/dev/null 2>&1
_check_repair
# block-form root directory & repeat
_create_proto 20
echo "=== version 1, twenty entries"
-mkfs_xfs $MKFSV1 | _filter_mkfs >/dev/null 2>&1
+_scratch_mkfs_xfs $MKFSV1 | _filter_mkfs >/dev/null 2>&1
_check_repair
echo "=== version 2, twenty entries (block form)"
-mkfs_xfs $MKFSV2 | _filter_mkfs >/dev/null 2>&1
+_scratch_mkfs_xfs $MKFSV2 | _filter_mkfs >/dev/null 2>&1
_check_repair
# leaf-form root directory & repeat
_create_proto 1000
echo "=== version 1, thousand entries"
-mkfs_xfs $MKFSV1 | _filter_mkfs >/dev/null 2>&1
+_scratch_mkfs_xfs $MKFSV1 | _filter_mkfs >/dev/null 2>&1
_check_repair
echo "=== version 2, thousand entries (leaf form)"
-mkfs_xfs $MKFSV2 | _filter_mkfs >/dev/null 2>&1
+_scratch_mkfs_xfs $MKFSV2 | _filter_mkfs >/dev/null 2>&1
_check_repair
# success, all done
=== version 1, one entry
Repairing, iteration 1
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
done
Repairing, iteration 2
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
done
Repairing, iteration 3
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
done
Repairing, iteration 4
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
=== version 2, one entry (shortform)
Repairing, iteration 1
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
done
Repairing, iteration 2
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
done
Repairing, iteration 3
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
done
Repairing, iteration 4
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
=== version 1, twenty entries
Repairing, iteration 1
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
done
Repairing, iteration 2
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
done
Repairing, iteration 3
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
done
Repairing, iteration 4
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
=== version 2, twenty entries (block form)
Repairing, iteration 1
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
done
Repairing, iteration 2
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
done
Repairing, iteration 3
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
done
Repairing, iteration 4
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
=== version 1, thousand entries
Repairing, iteration 1
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
done
Repairing, iteration 2
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
done
Repairing, iteration 3
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
done
Repairing, iteration 4
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
=== version 2, thousand entries (leaf form)
Repairing, iteration 1
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
done
Repairing, iteration 2
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
done
Repairing, iteration 3
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
done
Repairing, iteration 4
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
_require_scratch
# devzero blows away 512byte blocks, so make 512byte inodes (at least)
-mkfs_xfs $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
+_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
source $tmp.mkfs
[ $isize -lt 512 ] && \
- mkfs_xfs -isize=512 $SCRATCH_DEV | _filter_mkfs >/dev/null 2>&1
+ _scratch_mkfs_xfs -isize=512 | _filter_mkfs >/dev/null 2>&1
`xfs_db -r -c sb -c p $SCRATCH_DEV | grep 'ino = ' | \
sed -e 's/ //g' -e 's/^/export /'`
# check we won't get any quota inodes setup on mount
-mount -t xfs $SCRATCH_DEV $SCRATCH_MNT
+_scratch_mount
src/feature -U $SCRATCH_DEV && \
_notrun "Quota are enabled, test needs controlled sb recovery"
src/feature -G $SCRATCH_DEV && \
Corrupting root inode - setting bits to 0
Wrote X.XXKb (value 0x0)
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
- zero log...
- scan filesystem freespace and inode maps...
- found root inode chunk
Corrupting rt bitmap inode - setting bits to 0
Wrote X.XXKb (value 0x0)
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
- zero log...
- scan filesystem freespace and inode maps...
- found root inode chunk
Corrupting rt summary inode - setting bits to 0
Wrote X.XXKb (value 0x0)
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
- zero log...
- scan filesystem freespace and inode maps...
- found root inode chunk
Corrupting root inode - setting bits to -1
Wrote X.XXKb (value 0xffffffff)
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
- zero log...
- scan filesystem freespace and inode maps...
- found root inode chunk
Corrupting rt bitmap inode - setting bits to -1
Wrote X.XXKb (value 0xffffffff)
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
- zero log...
- scan filesystem freespace and inode maps...
- found root inode chunk
Corrupting rt summary inode - setting bits to -1
Wrote X.XXKb (value 0xffffffff)
Phase 1 - find and verify superblock...
-Phase 2 - using internal log
+Phase 2 - using <TYPEOF> log
- zero log...
- scan filesystem freespace and inode maps...
- found root inode chunk
umount $SCRATCH_DEV >/dev/null 2>&1
echo "*** MKFS ***" >>$seq.full
echo "" >>$seq.full
-mkfs_xfs $SCRATCH_DEV >>$seq.full 2>&1 \
+_scratch_mkfs_xfs >>$seq.full 2>&1 \
|| _fail "mkfs failed"
-mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$seq.full 2>&1 \
+_scratch_mount >>$seq.full 2>&1 \
|| _fail "mount failed"
echo "*** test"
-_check_fs $SCRATCH_DEV
+_check_scratch_fs
if ! touch $SCRATCH_MNT/fish
then
fi
# pv 801241 causes corruption here (inode left in agi_unlinked list)
-_check_fs $SCRATCH_DEV
+_check_scratch_fs
echo "*** done"
# happy exit
#agsize=16
agsize=32
echo -n "Make $agsize megabyte filesystem on SCRATCH_DEV and mount... "
-_do "mkfs_xfs -dsize=${agsize}m,agcount=1 $SCRATCH_DEV"
-_do "mount -t xfs $SCRATCH_DEV $SCRATCH_MNT"
+_do "_scratch_mkfs_xfs -dsize=${agsize}m,agcount=1"
+_do "_scratch_mount"
echo "done"
# full allocation group -> partial; partial -> expand partial + new partial;
_do "Grow filesystem to $size blocks" "xfs_growfs -D ${size} $SCRATCH_MNT"
echo -n "Flush filesystem... "
_do "umount $SCRATCH_MNT"
- _do "mount -t xfs $SCRATCH_DEV $SCRATCH_MNT"
+ _do "_scratch_mount"
echo "done"
echo -n "Check files... "
if ! _do "src/fill2fs_check $tmp.manifest"; then
# xfs_repair is going to need three to verify the superblock
rm -f $seq.full
-bmap_cmd="xfs_bmap -v"
-mnt_cmd="mount -t xfs $SCRATCH_DEV $SCRATCH_MNT"
_do_die_on_error=message_only
echo -n "Make a 48 megabyte filesystem on SCRATCH_DEV and mount... "
-_do "mkfs_xfs -dsize=48m,agcount=3 $SCRATCH_DEV"
-_do "$mnt_cmd"
+_do "_scratch_mkfs_xfs -dsize=48m,agcount=3"
+_do "_scratch_mount"
echo "done"
echo -n "Reserve 16 1Mb unfragmented regions... "
do
_do "dd if=/dev/zero of=$SCRATCH_MNT/hole$i bs=4096 count=256"
_do "dd if=/dev/zero of=$SCRATCH_MNT/space$i bs=4096 count=1"
- _do "$bmap_cmd $SCRATCH_MNT/hole$i"
+ _do "xfs_bmap -v $SCRATCH_MNT/hole$i"
done
echo "done"
echo "done"
# flush the filesystem - make sure there is no space "lost" to pre-allocation
_do "umount $SCRATCH_MNT"
-_do "$mnt_cmd"
+_do "_scratch_mount"
echo -n "Use up any further available space using dd... "
_do "dd if=/dev/zero of=$SCRATCH_MNT/pad bs=4096"
echo "done"
echo -n "Create one very large file... "
_do "src/fill2 -d nbytes=16000000,file=$SCRATCH_MNT/fragmented"
echo "done"
-_do "$bmap_cmd $SCRATCH_MNT/fragmented"
+_do "xfs_bmap -v $SCRATCH_MNT/fragmented"
_do "sum $SCRATCH_MNT/fragmented >$tmp.sum1"
_do "Remove other files" "rm -rf $SCRATCH_MNT/{pad,hole*}"
# defragment
_do "Run xfs_fsr on filesystem" "xfs_fsr -v $SCRATCH_DEV"
-_do "$bmap_cmd $SCRATCH_MNT/fragmented"
+_do "xfs_bmap -v $SCRATCH_MNT/fragmented"
_do "Check 4k files" "src/fill2fs_check $tmp.manifest"
# check
status=1; exit
fi
echo "done"
-_do "Checking filesystem" "_check_fs $SCRATCH_DEV"
+_do "Checking filesystem" "_check_scratch_fs"
# success, all done
echo "xfs_fsr tests passed."
_check_mount()
{
echo " *** mount (expect success)"
- if ! mount -t xfs -o logdev=$SCRATCH_LOGDEV $SCRATCH_DEV $SCRATCH_MNT
+ if ! _scratch_mount
then
echo " !!! mount failed (expecting success)"
status=1
_check_no_mount()
{
echo " *** mount (expect failure)"
- if mount -t xfs -o logdev=$SCRATCH_LOGDEV $SCRATCH_DEV $SCRATCH_MNT >$tmp.err 2>&1
+ if _scratch_mount >$tmp.err 2>&1
then
cat $tmp.err
echo " !!! mount succeeded (expecting failure)"
lversion=1
lsize=16777216
-ldev=$SCRATCH_LOGDEV
-MKFS_OPTIONS="-llogdev=$ldev,size=$lsize,version=$lversion"; export MKFS_OPTIONS
-
-mkfs_xfs $logopts $SCRATCH_DEV | _filter_mkfs 2>/dev/null
+_scratch_mkfs_xfs -lsize=$lsize,version=$lversion | _filter_mkfs 2>/dev/null
_check_mount
_check_require_logdev
. ./common.rc
. ./common.filter
-_get_uuid()
+_get_existing_uuid()
{
- xfs_db -r $1 -c "uuid" | $AWK_PROG '/^UUID/ { print $3 }'
+ xfs_db -r $TEST_DEV -c "uuid" | $AWK_PROG '/^UUID/ { print $3 }'
}
# real QA test starts here
_require_scratch
echo "*** get uuid"
-uuid=`_get_uuid $TEST_DEV`
+uuid=`_get_existing_uuid`
echo "*** mkfs"
-if ! mkfs_xfs $SCRATCH_DEV >$tmp.out 2>&1
+if ! _scratch_mkfs_xfs >$tmp.out 2>&1
then
cat $tmp.out
echo "!!! failed to mkfs on $SCRATCH_DEV"
fi
echo "*** mount fs with bad mount option (expect failure)"
-if mount -t xfs $SCRATCH_DEV $SCRATCH_MNT -o foobar >$tmp.out 2>&1
+if _scratch_mount -o foobar >$tmp.out 2>&1
then
cat $tmp.out
echo "!!! mount succeeded (expecting failure)"
fi
echo "*** duplicate uuid"
-xfs_db -x $SCRATCH_DEV -c "uuid $uuid" >/dev/null
+xfs_db -x -c "uuid $uuid" `_scratch_xfs_db_options` >/dev/null
echo "*** mount fs with duplicate uuid (expect failure)"
-if mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >$tmp.out 2>&1
+if _scratch_mount >$tmp.out 2>&1
then
cat $tmp.out
echo "!!! mount succeeded (expecting failure)"
|| _fail "!!! failed to mount"
_log "Create xfs fs in file on scratch"
-mkfs_xfs -dfile,name=$SCRATCH_MNT/test.xfs,size=20m >> $seq.full 2>&1 \
+/sbin/mkfs.xfs -f $MKFS_OPTIONS -dfile,name=$SCRATCH_MNT/test.xfs,size=20m \
+ >> $seq.full 2>&1 \
|| _fail "!!! failed to mkfs xfs"
_log "Make mount points"
# The actual point at which limit enforcement takes place for the
# hard block limit is variable depending on filesystem blocksize,
# and iosize. What we want to test is that the limit is enforced
-# (ie. blksize less than limit but not unduly less - ~85% is kind,
+# (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()
}
# real QA test starts here
-mkfs_xfs $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
+_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
cat $tmp.mkfs >>$seq.full
# keep the blocksize and data size for dd later
repquota -$type $SCRATCH_DEV | _filter_repquota 7
echo
-echo "*** push past the hard inode limit (expect EDQUOT)" | tee -a $seq.full
+echo "*** push past the hard inode limit (EDQUOT if enfd)" | tee -a $seq.full
for i in 1 2 3 4 5 6 7 8 9 10 11 12
do
_file_as_id $SCRATCH_MNT/hard$i $id $type 1024 0
repquota -$type $SCRATCH_DEV | _filter_repquota 7
echo
-echo "*** push past the hard block limit (expect EDQUOT)" | tee -a $seq.full
+echo "*** push past the hard block limit (EDQUOT is enfd)" | tee -a $seq.full
_file_as_id $SCRATCH_MNT/softie $id $type 1024 540
_qmount
repquota -$type $SCRATCH_DEV | _filter_and_check_blocks 7
fi
# real QA test starts here
-mkfs_xfs $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
+_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
cat $tmp.mkfs >>$seq.full
chmod a+w $seq.full # arbitrary users will write here
test=$SCRATCH_MNT/test
# make filesystem on scratch using the defaults
-_do 'make filesystem on $SCRATCH_DEV' \
- 'mkfs_xfs $SCRATCH_DEV'
-_do 'mount filesytem' \
- 'mount -t xfs $SCRATCH_DEV $SCRATCH_MNT'
+_do 'make filesystem on $SCRATCH_DEV' '_scratch_mkfs_xfs'
+_do 'mount filesytem' '_scratch_mount'
# create test files and set acls
acls="
echo "acls before repair:"
list_acls
_do 'unmount $SCRATCH_DEV' 'umount $SCRATCH_DEV'
-_do 'repair filesystem' 'xfs_repair $SCRATCH_DEV'
-_do 'mount filesytem' 'mount -t xfs $SCRATCH_DEV $SCRATCH_MNT'
+_do 'repair filesystem' '_scratch_xfs_repair'
+_do 'mount filesytem' '_scratch_mount'
echo "acls after repair: "
list_acls
_exercise()
{
- mkfs_xfs $SCRATCH_DEV >/dev/null 2>&1
+ _scratch_mkfs_xfs >/dev/null 2>&1
_qmount
umask 022
}
# real QA test starts here
-mkfs_xfs $SCRATCH_DEV >/dev/null 2>&1
-MOUNT_OPTIONS="-o usrquota,grpquota"; export MOUNT_OPTIONS
+_scratch_mkfs_xfs $SCRATCH_DEV >/dev/null 2>&1
+MOUNT_OPTIONS="$MOUNT_OPTIONS -ousrquota,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_xfs $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
-mount -t xfs $SCRATCH_DEV $SCRATCH_MNT || _fail "mount failed"
+_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
+_scratch_mount || _fail "mount failed"
_create_test_bed
for nsp in user trusted; do
# so don't run it
#
umount $SCRATCH_DEV 2>/dev/null
-mount -t xfs $SCRATCH_DEV $SCRATCH_MNT
+_scratch_mount
$here/src/feature -U $SCRATCH_DEV && \
_notrun "Quota enabled, test needs controlled xfsdump output"
$here/src/feature -G $SCRATCH_DEV && \
#! /bin/sh
# XFS QA Test No. 067
-# $Id: 067,v 1.6 2002/06/05 20:14:16 sandeen Exp $
+# $Id: 067,v 1.7 2003/05/22 04:16:45 fsgqa Exp $
#
# Test out acl/dacls which fit in shortform in the inode
#
# set up fs for 1K inodes
export MKFS_OPTIONS="-i size=1024"
-mkfs_xfs $SCRATCH_DEV>>$here/$seq.full ||\
- _error "mkfs failed"
-mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$here/$seq.full ||\
- _error "mount failed"
+_scratch_mkfs_xfs >>$here/$seq.full || _error "mkfs failed"
+_scratch_mount >>$here/$seq.full || _error "mount failed"
cd $SCRATCH_MNT
# xfs_growfs -n $SCRATCH_MNT
#! /bin/sh
# XFS QA Test No. 069
-# $Id: 069,v 1.2 2002/09/04 11:14:37 fsgqa Exp $
+# $Id: 069,v 1.3 2003/05/22 04:16:45 fsgqa Exp $
#
# Test out writes with O_APPEND flag sets.
#
umount $SCRATCH_DEV >/dev/null 2>&1
echo "*** mkfs"
-mkfs_xfs $SCRATCH_DEV >/dev/null \
- || _fail "mkfs failed"
+_scratch_mkfs_xfs >/dev/null || _fail "mkfs failed"
echo "*** mount FS"
-mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >/dev/null \
- || _fail "mount failed"
+_scratch_mount >/dev/null || _fail "mount failed"
cd $SCRATCH_MNT
- setenv TAPE_DEV "tape device for testing xfsdump"
- setenv RMT_TAPE_DEV "remote tape device for testing xfsdump"
- setenv RMT_IRIXTAPE_DEV "remote IRIX tape device for testing xfsdump"
- - optionally:
- - setenv SCRATCH_LOGDEV "device for external log"
- - setenv SCRATCH_RTDEV "device for realtime data"
+ - optionally:
+ - setenv SCRATCH_LOGDEV "device for scratch-fs external log"
+ - setenv SCRATCH_RTDEV "device for scratch-fs realtime data"
+ - setenv TEST_LOGDEV "device for test-fs external log"
+ - setenv TEST_RTDEV "device for test-fs realtime data"
+ - if TEST_LOGDEV and/or TEST_RTDEV, these will always be used.
+ - if SCRATCH_LOGDEV and/or SCRATCH_RTDEV, the USE_EXTERNAL
+ environment variable set to "yes" will enable their use.
- or add a case to the switch in common.config assigning
these variables based on the hostname of your test
machine
# generation purposes).
#
#-----------------------------------------------------------------------
-# Copyright (c) 2002 Silicon Graphics, Inc. All Rights Reserved.
+# Copyright (c) 2002-2003 Silicon Graphics, Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License as
exit 1
}
-bench_mkfs_xfs()
-{
- mkfs_xfs -f $extra_mkfs_options $@
-}
-
-bench_mount_xfs()
-{
- mount -t xfs $extra_mount_options $@
-}
-
_run_benchmark()
{
pass=1
while [ $pass -le $passes -o $passes -lt 0 ]
do
_log " *** clean scratch device [$bench starting, pass $pass]"
- bench_mkfs_xfs $SCRATCH_DEV 2>&1 | _fix_malloc >>$FULL \
- || _fail " !!! mkfs SCRATCH_DEV failed"
-
+ _scratch_mkfs_xfs 2>&1 | _fix_malloc >>$FULL
_log " *** mounting scratch device"
- bench_mount_xfs $SCRATCH_DEV $SCRATCH_MNT \
- || _fail " !!! failed to mount"
+ _scratch_mount || _fail " !!! failed to mount"
_log " *** mkdir"
mkdir $SCRATCH_MNT/bench \
|| _fail " !!! failed to umount"
_log " *** post-umount filesystem check"
- _check_fs $SCRATCH_DEV
+ _check_scratch_fs
let "pass = pass + 1"
done
_require_scratch
rm -f bench.* results.*
-if [ ! -z "$SCRATCH_LOGDEV" -a ! -z "$USE_SCRATCH_LOGDEV" ]
-then
- extra_log_options="-l $SCRATCH_LOGDEV"
- extra_mkfs_options="-llogdev=$SCRATCH_LOGDEV"
- extra_mount_options="-ologdev=$SCRATCH_LOGDEV"
-fi
+FULL_MKFS_OPTIONS=`_scratch_mkfs_options`
+FULL_MOUNT_OPTIONS=`_scratch_mount_options`
# $OUT is the report which will ultimately be sent, keep it tidy.
cat >$OUT <<EOF
-bench: MKFS_OPTIONS=$MKFS_OPTIONS $extra_mkfs_options
-bench: MOUNT_OPTIONS=$MOUNT_OPTIONS $extra_mount_options
+bench: MKFS_OPTIONS -- $FULL_MKFS_OPTIONS
+bench: MOUNT_OPTIONS --$FULL_MOUNT_OPTIONS
EOF
echo "" >$LOG
_log "*** benchmark started [passes=$passes, benchmark=$bench]"
_log "*** (`date`)"
- _log "*** MKFS_OPTIONS=$MKFS_OPTIONS"
- _log "*** MOUNT_OPTIONS=$MOUNT_OPTIONS"
+ _log "MKFS_OPTIONS -- $FULL_MKFS_OPTIONS"
+ _log "MOUNT_OPTIONS -- $FULL_MOUNT_OPTIONS"
_log " *** unmounting scratch device"
umount $SCRATCH_DEV 2>&1 | _fix_malloc >>$FULL
[ -f check.time ] || touch check.time
-if [ ! -z "$MKFS_OPTIONS" ]
+FULL_MKFS_OPTIONS=`_scratch_mkfs_options`
+echo check: MKFS_OPTIONS -- $FULL_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 ! _scratch_mkfs_xfs -f >$tmp.err 2>&1
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
+ echo "our local _scratch_mkfs_xfs routine ..."
+ cat $tmp.err
+ echo "check: failed to mkfs.xfs \$SCRATCH_DEV using specified options"
+ exit 1
fi
-if [ ! -z "$MOUNT_OPTIONS" ]
+FULL_MOUNT_OPTIONS=`_scratch_mount_options`
+echo check: MOUNT_OPTIONS -- $FULL_MOUNT_OPTIONS
+# call the overridden mount - make sure the FS mounts with
+# the same options that we'll mount with later.
+if ! _scratch_mount >$tmp.err 2>&1
then
- echo "check: \$MOUNT_OPTIONS specified -- \"$MOUNT_OPTIONS\""
- umount $TEST_DEV
- # call the overridden mount - make sure the FS starts as
- # the same as we'll set it later.
- if ! mount -t xfs $TEST_DEV $TEST_DIR >$tmp.err 2>&1
- then
- echo "our local mount routine ..."
- cat $tmp.err
- # call the normal mount
- echo "normal mount ..."
- /bin/mount -t xfs $TEST_DEV $TEST_DIR
- echo "check: failed to mount \$TEST_DEV using specified mount options"
- exit 1
- fi
+ echo "our local mount routine ..."
+ cat $tmp.err
+ echo "check: failed to mount \$SCRATCH_DEV using specified options"
+ exit 1
fi
seq="check"
-_check_fs $TEST_DEV
+_check_test_fs
for seq in $list
do
[ -f $seq.notrun ] || try=`expr $try + 1`
seq="after_$seq"
- _check_fs $TEST_DEV
+ _check_test_fs
done
##/bin/sh
#
-# Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
+# Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License as
#
# and optionally:
# SCRATCH_LOGDEV - scratch log device for external log testing
-# SCRATCH_RTDEV - scratch rt dev (only for testing cmds currently)
+# SCRATCH_RTDEV - scratch rt dev
+# TEST_LOGDEV - test log device for external log testing
+# TEST_RTDEV - test rt dev
# TAPE_DEV - the tape device for the xfsdump tests
# RMT_TAPE_DEV - the remote tape device for the xfsdump tests
# RMT_IRIXTAPE_DEV - the IRIX remote tape device for the xfsdump tests
EMAIL="nathans@larry"
SCRATCH_MNT=/mnt/xfs0
SCRATCH_DEV=/dev/sdb5
- SCRATCH_RTDEV=/dev/sda9
+ #SCRATCH_RTDEV=/dev/sda9
SCRATCH_LOGDEV=/dev/sda11
TEST_DIR=/mnt/xfs1
TEST_DEV=/dev/sda10
{
_require_scratch
- mkfs_xfs $SCRATCH_DEV>>$here/$seq.full ||\
- _error "mkfs failed"
-
- mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$here/$seq.full ||\
- _error "mount failed"
+ _scratch_mkfs_xfs >>$here/$seq.full || _error "mkfs failed"
+ _scratch_mount >>$here/$seq.full || _error "mount failed"
}
#
done
if [ $status -ne $NOTRUNSTS ]; then
- # Sleep added to stop _check_fs from complaining that the
+ # Sleep added to stop _check_scratch_fs from complaining that the
# scratch_dev is still busy
sleep 10
- _check_fs $SCRATCH_DEV
+ _check_scratch_fs
fi
}
_stable_fs()
{
_saveddir=`pwd`; cd /
- umount $SCRATCH_MNT >>$here/$seq.full ||\
- _error "unmount failed"
- mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$here/$seq.full ||\
- _error "mount failed"
+ umount $SCRATCH_MNT >>$here/$seq.full || _error "unmount failed"
+ _scratch_mount >>$here/$seq.full || _error "mount failed"
cd $_saveddir
}
_qmount()
{
umount $SCRATCH_DEV >/dev/null 2>&1
- mount -t xfs $SCRATCH_DEV $SCRATCH_MNT || _fail "qmount failed"
+ _scratch_mount || _fail "qmount failed"
chmod ugo+rwx $SCRATCH_MNT
[ -x /usr/sbin/quot ] && quot $SCRATCH_MNT >>$seq.full 2>&1
}
##/bin/sh
#
-# Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
+# Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License as
# awk
AWK_PROG=awk
-# ps
-PS_HAVE_BSD=false
-PS_ALL_FLAGS=-efw
-
-# host os
-PLATFORM=linux
-
# extra parameters for fsstress
-FSSTRESS_AVOID=
-
-# env variables for mem checking
-#EF_PROTECT_FREE=1 # efence
-#export EF_PROTECT_FREE
-# Not used because we get weird errors of form:
-# ElectricFence Exiting: mmap() failed: Cannot allocate memory
+FSSTRESS_AVOID="-f resvsp=0 -f unresvsp=0"
-export AWK_PROG PS_HAVE_BSD PS_ALL_FLAGS PLATFORM
+export AWK_PROG FSSTRESS_AVOID
# we override mount and mkfs.xfs so we can specify extra options
esac
}
-mkfs_xfs()
+_test_mount()
+{
+ TEST_OPTIONS=""
+ [ -z "$TEST_RTDEV" ] || TEST_OPTIONS="$TEST_OPTIONS -ortdev=$TEST_RTDEV"
+ [ -z "$TEST_LOGDEV" ] || TEST_OPTIONS="$TEST_OPTIONS -ologdev=$TEST_LOGDEV"
+ mount -t xfs $TEST_OPTIONS $* $TEST_DEV $TEST_DIR
+}
+
+_scratch_mount_options()
{
- /sbin/mkfs.xfs -f $* $MKFS_OPTIONS
+ SCRATCH_OPTIONS=""
+ [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ] && \
+ SCRATCH_OPTIONS="$SCRATCH_OPTIONS -ortdev=$SCRATCH_RTDEV"
+ [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
+ SCRATCH_OPTIONS="$SCRATCH_OPTIONS -ologdev=$SCRATCH_LOGDEV"
+ echo $SCRATCH_OPTIONS $* $SCRATCH_DEV $SCRATCH_MNT
+}
+
+_scratch_mount()
+{
+ SCRATCH_OPTIONS=""
+ [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ] && \
+ SCRATCH_OPTIONS="$SCRATCH_OPTIONS -ortdev=$SCRATCH_RTDEV"
+ [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
+ SCRATCH_OPTIONS="$SCRATCH_OPTIONS -ologdev=$SCRATCH_LOGDEV"
+ mount -t xfs $SCRATCH_OPTIONS $* $SCRATCH_DEV $SCRATCH_MNT
+}
+
+_scratch_mkfs_options()
+{
+ SCRATCH_OPTIONS=""
+ [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ] && \
+ SCRATCH_OPTIONS="$SCRATCH_OPTIONS -rrtdev=$SCRATCH_RTDEV"
+ [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
+ SCRATCH_OPTIONS="$SCRATCH_OPTIONS -llogdev=$SCRATCH_LOGDEV"
+ echo $SCRATCH_OPTIONS $MKFS_OPTIONS $* $SCRATCH_DEV
+}
+
+_scratch_mkfs_xfs()
+{
+ SCRATCH_OPTIONS=""
+ [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ] && \
+ SCRATCH_OPTIONS="$SCRATCH_OPTIONS -rrtdev=$SCRATCH_RTDEV"
+ [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
+ SCRATCH_OPTIONS="$SCRATCH_OPTIONS -llogdev=$SCRATCH_LOGDEV"
+ /sbin/mkfs.xfs -f $SCRATCH_OPTIONS $MKFS_OPTIONS $* $SCRATCH_DEV
+}
+
+_scratch_xfs_db_options()
+{
+ SCRATCH_OPTIONS=""
+ [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
+ SCRATCH_OPTIONS="-l$SCRATCH_LOGDEV"
+ echo $SCRATCH_OPTIONS $* $SCRATCH_DEV
+}
+
+_scratch_xfs_logprint()
+{
+ SCRATCH_OPTIONS=""
+ [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
+ SCRATCH_OPTIONS="-l$SCRATCH_LOGDEV"
+ /usr/sbin/xfs_logprint $SCRATCH_OPTIONS $* $SCRATCH_DEV
+}
+
+_scratch_xfs_repair()
+{
+ SCRATCH_OPTIONS=""
+ [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
+ SCRATCH_OPTIONS="-l$SCRATCH_LOGDEV"
+ /sbin/xfs_repair $SCRATCH_OPTIONS $* $SCRATCH_DEV
}
_get_pids_by_name()
#
_require_logdev()
{
- if [ -z "$SCRATCH_LOGDEV" -o ! -b "$SCRATCH_LOGDEV" ]
- then
+ [ -z "$SCRATCH_LOGDEV" -o ! -b "$SCRATCH_LOGDEV" ] && \
_notrun "This test requires a valid \$SCRATCH_LOGDEV"
- fi
+ [ "$USE_EXTERNAL" != yes ] && \
+ _notrun "This test requires USE_EXTERNAL to be enabled"
+
# ensure its not mounted
umount $SCRATCH_LOGDEV 2>/dev/null
}
}
-# run xfs_check on a FS.
+# run xfs_check and friends on a FS.
#
# if the filesystem is mounted, it's either remounted ro before being
# checked or it's unmounted and then remounted
USE_REMOUNT=0
-_check_fs()
+_check_filesystem()
{
- if [ $# -ne 1 ]
+ if [ $# -ne 1 -a $# -ne 2 ]
then
- echo "Usage: _check_fs device" 1>&2
+ echo "Usage: _check_fs device [logdevice]" 1>&2
exit 1
fi
device=$1
+ if [ $# -eq 2 -a "$2" != "" ]; then
+ extra_log_options="-l$2"
+ extra_mount_options="-ologdev=$2"
+ fi
type=`_fs_type $device`
ok=1
fi
fi
- xfs_logprint -t $device $extra_log_options 2>&1 \
+ /usr/sbin/xfs_logprint -t $device $extra_log_options 2>&1 \
| tee $tmp.fs_check | grep -q "<CLEAN>"
if [ $? -ne 0 ]
then
ok=0
fi
-
- xfs_check $device 2>&1 | _fix_malloc >$tmp.fs_check
+
+ /usr/sbin/xfs_check $device 2>&1 | _fix_malloc >$tmp.fs_check
if [ -s $tmp.fs_check ]
then
echo "_check_fs: filesystem on $device is inconsistent (c) (see $seq.full)"
ok=0
fi
- if ! xfs_repair -n $device $extra_log_options >$tmp.fs_check 2>&1
+ if ! /sbin/xfs_repair -n $device $extra_log_options >$tmp.fs_check 2>&1
then
echo "_check_fs: filesystem on $device is inconsistent (r) (see $seq.full)"
# mounted...
if [ $USE_REMOUNT -eq 0 ]
then
- if ! mount -t xfs $device $mountpoint
+ if ! mount -t xfs $extra_mount_options $device $mountpoint
then
echo "!!! failed to remount $device on $mountpoint"
ok=0
return 0
}
+_check_test_fs()
+{
+ _check_filesystem $TEST_DEV $TEST_LOGDEV
+}
+
+_check_scratch_fs()
+{
+ SCRATCH_LOG=""
+ [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
+ SCRATCH_LOG="$SCRATCH_LOGDEV"
+ _check_filesystem $SCRATCH_DEV $SCRATCH_LOG
+}
+
################################################################################
[ -d /usr/bsd ] && PATH=$PATH:/usr/bsd
if [ -z "`_fs_type $TEST_DEV`" ]
then
# $TEST_DEV is not mounted
- if ! mount -t xfs $TEST_DEV $TEST_DIR
+ if ! _test_mount
then
echo "common.rc: could not mount $TEST_DEV on $TEST_DIR"
exit 1
s/(cleared root inode) (\d+)/\1 INO/;
s/(resetting inode) (\d+)/\1 INO/;
s/(disconnected dir inode) (\d+)/\1 INO/;
+# for log
+s/internal log/<TYPEOF> log/g;
+s/external log on \S+/<TYPEOF> log/g;
print;'
}
value=$1
structure="$2"
_zero_position $value "$structure"
- xfs_repair $SCRATCH_DEV 2>&1 | _filter_repair
+ _scratch_xfs_repair 2>&1 | _filter_repair
# some basic sanity checks...
- _check_fs $SCRATCH_DEV
- mount -t xfs $SCRATCH_DEV $SCRATCH_MNT #mount
+ _check_scratch_fs
+ _scratch_mount #mount
dd if=/bin/sh of=$SCRATCH_MNT/sh 2>&1 |_filter_dd #open,write
dd if=$SCRATCH_MNT/sh of=/dev/null 2>&1 |_filter_dd #read
rm -f $SCRATCH_MNT/sh #unlink
# ioctl - tests which use ioctl commands (directly/indirectly)
ioctl nathans@sgi.com
+# testing large sector support, excluded tests
+sectors nathans@sgi.com
+
# test-group association ... one line per test
#
001 rw dir auto
010 other auto
011 dir auto
012 rw auto
-013 other ioctl auto
+013 other ioctl auto sectors
014 rw auto
015 other auto
016 rw auto
_log " *** pass $pass (`date`)"
_log " *** check"
- _check_fs $SCRATCH_DEV
+ _check_scratch_fs
_log " *** mounting scratch device"
- if ! mount -t xfs $SCRATCH_DEV $SCRATCH_MNT 2>&1 | _logp
+ if ! _scratch_mount 2>&1 | _logp
then
_fail " !!! failed to mount"
fi
|| _fail " !!! couldn't delete old dir"
_log " *** check"
- _check_fs $SCRATCH_DEV
+ _check_scratch_fs
fi
_log " *** mkdir"