mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
Try to simplify log QA with mnt and mkfs options.
Add new test 086 for log replay with v2 logs. Need to write more tests with varying metadata ops. simplify
This commit is contained in:
@@ -64,7 +64,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
# prelim
|
||||
rm -f $seq.full $tmp.*
|
||||
_require_scratch
|
||||
_clear_opts
|
||||
echo "*** init FS"
|
||||
umount $SCRATCH_DEV >/dev/null 2>&1
|
||||
|
||||
@@ -82,25 +81,26 @@ EOF
|
||||
cat $tmp.seq.params \
|
||||
| while read mkfs mnt restofline
|
||||
do
|
||||
if [ "$mkfs" != "#" ]; then
|
||||
_mkfs_log $mkfs
|
||||
_create_log $mnt
|
||||
_check_log
|
||||
|
||||
_print_operation
|
||||
_cmp_op_output $seq.op $filtered
|
||||
|
||||
_print_transaction_inode 2
|
||||
_cmp_output $seq.trans_inode $filtered
|
||||
|
||||
_print_transaction_buf 2
|
||||
_cmp_output $seq.trans_buf $filtered
|
||||
if [ "$mkfs" = "#" ]; then
|
||||
continue
|
||||
fi
|
||||
export MKFS_OPTIONS=$mkfs
|
||||
export MOUNT_OPTIONS=$mnt
|
||||
_mkfs_log
|
||||
_create_log
|
||||
_check_log
|
||||
|
||||
_print_operation
|
||||
_cmp_op_output $seq.op $filtered
|
||||
|
||||
_print_transaction_inode 2
|
||||
_cmp_output $seq.trans_inode $filtered
|
||||
|
||||
_print_transaction_buf 2
|
||||
_cmp_output $seq.trans_buf $filtered
|
||||
done
|
||||
|
||||
# got thru it all so we may have success
|
||||
if [ ! -e $tmp.error ]; then
|
||||
status=0
|
||||
fi
|
||||
status=0
|
||||
|
||||
exit
|
||||
|
||||
@@ -1,47 +1,17 @@
|
||||
QA output created by 018
|
||||
*** init FS
|
||||
meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
|
||||
data = bsize=XXX blocks=XXX, imaxpct=PCT
|
||||
= sunit=XXX swidth=XXX, unwritten=X
|
||||
naming =VERN bsize=XXX
|
||||
log =LDEV bsize=XXX blocks=XXX
|
||||
realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
|
||||
*** compare logprint: 018.op with 018.fulldir/op.mnt-ologbsize=32k.mkfs-lversion=1.filtered
|
||||
*** compare logprint: 018.trans_inode with 018.fulldir/trans_inode.mnt-ologbsize=32k.mkfs-lversion=1.filtered
|
||||
*** compare logprint: 018.trans_buf with 018.fulldir/trans_buf.mnt-ologbsize=32k.mkfs-lversion=1.filtered
|
||||
meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
|
||||
data = bsize=XXX blocks=XXX, imaxpct=PCT
|
||||
= sunit=XXX swidth=XXX, unwritten=X
|
||||
naming =VERN bsize=XXX
|
||||
log =LDEV bsize=XXX blocks=XXX
|
||||
realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
|
||||
*** compare logprint: 018.op with 018.fulldir/op.mnt-ologbsize=32k.mkfs-lversion=2.filtered
|
||||
*** compare logprint: 018.trans_inode with 018.fulldir/trans_inode.mnt-ologbsize=32k.mkfs-lversion=2.filtered
|
||||
*** compare logprint: 018.trans_buf with 018.fulldir/trans_buf.mnt-ologbsize=32k.mkfs-lversion=2.filtered
|
||||
meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
|
||||
data = bsize=XXX blocks=XXX, imaxpct=PCT
|
||||
= sunit=XXX swidth=XXX, unwritten=X
|
||||
naming =VERN bsize=XXX
|
||||
log =LDEV bsize=XXX blocks=XXX
|
||||
realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
|
||||
*** compare logprint: 018.op with 018.fulldir/op.mnt-ologbsize=64k.mkfs-lversion=2.filtered
|
||||
*** compare logprint: 018.trans_inode with 018.fulldir/trans_inode.mnt-ologbsize=64k.mkfs-lversion=2.filtered
|
||||
*** compare logprint: 018.trans_buf with 018.fulldir/trans_buf.mnt-ologbsize=64k.mkfs-lversion=2.filtered
|
||||
meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
|
||||
data = bsize=XXX blocks=XXX, imaxpct=PCT
|
||||
= sunit=XXX swidth=XXX, unwritten=X
|
||||
naming =VERN bsize=XXX
|
||||
log =LDEV bsize=XXX blocks=XXX
|
||||
realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
|
||||
*** compare logprint: 018.op with 018.fulldir/op.mnt-ologbsize=128k.mkfs-lversion=2.filtered
|
||||
*** compare logprint: 018.trans_inode with 018.fulldir/trans_inode.mnt-ologbsize=128k.mkfs-lversion=2.filtered
|
||||
*** compare logprint: 018.trans_buf with 018.fulldir/trans_buf.mnt-ologbsize=128k.mkfs-lversion=2.filtered
|
||||
meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
|
||||
data = bsize=XXX blocks=XXX, imaxpct=PCT
|
||||
= sunit=XXX swidth=XXX, unwritten=X
|
||||
naming =VERN bsize=XXX
|
||||
log =LDEV bsize=XXX blocks=XXX
|
||||
realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
|
||||
*** compare logprint: 018.op with 018.fulldir/op.mnt-ologbsize=256k.mkfs-lversion=2.filtered
|
||||
*** compare logprint: 018.trans_inode with 018.fulldir/trans_inode.mnt-ologbsize=256k.mkfs-lversion=2.filtered
|
||||
*** compare logprint: 018.trans_buf with 018.fulldir/trans_buf.mnt-ologbsize=256k.mkfs-lversion=2.filtered
|
||||
|
||||
@@ -81,7 +81,7 @@ then
|
||||
exit
|
||||
fi
|
||||
|
||||
if ! src/xfsctl $SCRATCH_MNT $SCRATCH_MNT/fish >/dev/null 2>&1
|
||||
if ! src/xfsctl $SCRATCH_MNT $SCRATCH_MNT/fish >>$seq.full 2>&1
|
||||
then
|
||||
echo "!!! failed to run xfsctl test program"
|
||||
exit
|
||||
@@ -98,6 +98,5 @@ _check_scratch_fs
|
||||
|
||||
echo "*** done"
|
||||
# happy exit
|
||||
rm -f $seq.full
|
||||
status=0
|
||||
exit 0
|
||||
|
||||
@@ -64,22 +64,18 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
# prelim
|
||||
rm -f $seq.full $tmp.*
|
||||
_require_scratch
|
||||
_clear_opts
|
||||
echo "*** init FS"
|
||||
umount $SCRATCH_DEV >/dev/null 2>&1
|
||||
|
||||
# do a simple quota test to ensure DQUOT data is happening
|
||||
mkfs="-lversion=1"
|
||||
mnt="-ousrquota,grpquota"
|
||||
_mkfs_log $mkfs
|
||||
_create_log $mnt
|
||||
export MKFS_OPTIONS="-lversion=1"
|
||||
export MOUNT_OPTIONS="-ousrquota,grpquota"
|
||||
_mkfs_log
|
||||
_create_log
|
||||
_check_log
|
||||
_print_transaction_inode 2
|
||||
_cmp_output $seq.ugquota.trans_inode $filtered
|
||||
|
||||
# got thru it all so we may have success
|
||||
if [ ! -e $tmp.error ]; then
|
||||
status=0
|
||||
fi
|
||||
|
||||
status=0
|
||||
exit
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
QA output created by 081
|
||||
*** init FS
|
||||
meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
|
||||
data = bsize=XXX blocks=XXX, imaxpct=PCT
|
||||
= sunit=XXX swidth=XXX, unwritten=X
|
||||
naming =VERN bsize=XXX
|
||||
log =LDEV bsize=XXX blocks=XXX
|
||||
realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
|
||||
*** compare logprint: 081.ugquota.trans_inode with 081.fulldir/trans_inode.mnt-ousrquota,grpquota.mkfs-lversion=1.filtered
|
||||
*** unmount
|
||||
|
||||
@@ -64,7 +64,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
# prelim
|
||||
rm -f $seq.full $tmp.*
|
||||
_require_scratch
|
||||
_clear_opts
|
||||
echo "*** init FS"
|
||||
umount $SCRATCH_DEV >/dev/null 2>&1
|
||||
|
||||
@@ -93,41 +92,45 @@ for s in sync nosync ; do
|
||||
cat $tmp.seq.params \
|
||||
| while read mkfs mnt start restofline
|
||||
do
|
||||
if [ "$mkfs" != "#" ]; then
|
||||
echo "--- mkfs=$mkfs, mnt=$mnt, start=$start, sync=$s ---"
|
||||
_mkfs_log $mkfs
|
||||
if [ $s = "sync" ]; then
|
||||
_create_log_sync $mnt
|
||||
else
|
||||
_create_log $mnt
|
||||
fi
|
||||
_check_log
|
||||
|
||||
sync_suffix=".$s"
|
||||
|
||||
if [ $s = "sync" ]; then
|
||||
# if sync then we have chance of DATA FORK EXTENTS items
|
||||
# not hanging around very long due to inode syncing to disk
|
||||
# (see comment in xfs_iflush_int())
|
||||
# and this is to hard to reconcile in the op output
|
||||
:
|
||||
else
|
||||
_print_operation
|
||||
_cmp_op_output $seq.op $filtered
|
||||
fi
|
||||
|
||||
_print_transaction_inode $start
|
||||
_cmp_output $seq.trans_inode $filtered
|
||||
|
||||
_print_transaction_buf $start
|
||||
_cmp_output $seq.trans_buf $filtered
|
||||
if [ "$mkfs" = "#" ]; then
|
||||
continue
|
||||
fi
|
||||
echo "--- mkfs=$mkfs, mnt=$mnt, start=$start, sync=$s ---"
|
||||
export MOUNT_OPTIONS=$mnt
|
||||
export MKFS_OPTIONS=$mkfs
|
||||
if ! _mkfs_log; then
|
||||
continue
|
||||
fi
|
||||
if [ $s = "sync" ]; then
|
||||
_create_log_sync
|
||||
else
|
||||
_create_log
|
||||
fi
|
||||
if [ $? -ne 0 ]; then
|
||||
continue
|
||||
fi
|
||||
_check_log
|
||||
|
||||
sync_suffix=".$s"
|
||||
|
||||
if [ $s = "sync" ]; then
|
||||
# if sync then we have chance of DATA FORK EXTENTS items
|
||||
# not hanging around very long due to inode syncing to disk
|
||||
# (see comment in xfs_iflush_int())
|
||||
# and this is to hard to reconcile in the op output
|
||||
:
|
||||
else
|
||||
_print_operation
|
||||
_cmp_op_output $seq.op $filtered
|
||||
fi
|
||||
|
||||
_print_transaction_inode $start
|
||||
_cmp_output $seq.trans_inode $filtered
|
||||
|
||||
_print_transaction_buf $start
|
||||
_cmp_output $seq.trans_buf $filtered
|
||||
done
|
||||
done
|
||||
|
||||
# got thru it all so we may have success
|
||||
if [ ! -e $tmp.error ]; then
|
||||
status=0
|
||||
fi
|
||||
|
||||
status=0
|
||||
exit
|
||||
|
||||
@@ -1,78 +1,40 @@
|
||||
QA output created by 082
|
||||
*** init FS
|
||||
--- mkfs=-lversion=2, mnt=-ologbsize=32k, start=2, sync=sync ---
|
||||
meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
|
||||
data = bsize=XXX blocks=XXX, imaxpct=PCT
|
||||
= sunit=XXX swidth=XXX, unwritten=X
|
||||
naming =VERN bsize=XXX
|
||||
log =LDEV bsize=XXX blocks=XXX
|
||||
realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
|
||||
*** compare logprint: 082.trans_inode with 082.fulldir/trans_inode.mnt-ologbsize=32k.mkfs-lversion=2.sync.filtered
|
||||
*** compare logprint: 082.trans_buf with 082.fulldir/trans_buf.mnt-ologbsize=32k.mkfs-lversion=2.sync.filtered
|
||||
--- mkfs=-lversion=2,su=4096, mnt=-ologbsize=32k, start=8, sync=sync ---
|
||||
meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
|
||||
data = bsize=XXX blocks=XXX, imaxpct=PCT
|
||||
= sunit=XXX swidth=XXX, unwritten=X
|
||||
naming =VERN bsize=XXX
|
||||
log =LDEV bsize=XXX blocks=XXX
|
||||
realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
|
||||
*** compare logprint: 082.trans_inode with 082.fulldir/trans_inode.mnt-ologbsize=32k.mkfs-lversion=2,su=4096.sync.filtered
|
||||
*** compare logprint: 082.trans_buf with 082.fulldir/trans_buf.mnt-ologbsize=32k.mkfs-lversion=2,su=4096.sync.filtered
|
||||
--- mkfs=-lversion=2,su=32768, mnt=-ologbsize=32k, start=64, sync=sync ---
|
||||
meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
|
||||
data = bsize=XXX blocks=XXX, imaxpct=PCT
|
||||
= sunit=XXX swidth=XXX, unwritten=X
|
||||
naming =VERN bsize=XXX
|
||||
log =LDEV bsize=XXX blocks=XXX
|
||||
realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
|
||||
*** compare logprint: 082.trans_inode with 082.fulldir/trans_inode.mnt-ologbsize=32k.mkfs-lversion=2,su=32768.sync.filtered
|
||||
*** compare logprint: 082.trans_buf with 082.fulldir/trans_buf.mnt-ologbsize=32k.mkfs-lversion=2,su=32768.sync.filtered
|
||||
--- mkfs=-lversion=2,su=36864, mnt=-ologbsize=32k, start=72, sync=sync ---
|
||||
meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
|
||||
data = bsize=XXX blocks=XXX, imaxpct=PCT
|
||||
= sunit=XXX swidth=XXX, unwritten=X
|
||||
naming =VERN bsize=XXX
|
||||
log =LDEV bsize=XXX blocks=XXX
|
||||
realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
|
||||
mount failed: -ologbsize=32k
|
||||
(see 082.full for details)
|
||||
|
||||
*** mount failed: -ologbsize=32k ***
|
||||
|
||||
--- mkfs=-lversion=2,su=5120, mnt=-ologbsize=32k, start=10, sync=sync ---
|
||||
|
||||
*** Cannot mkfs for this test using option specified: -lversion=2,su=5120 -lsize=2000b ***
|
||||
|
||||
--- mkfs=-lversion=2, mnt=-ologbsize=32k, start=2, sync=nosync ---
|
||||
meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
|
||||
data = bsize=XXX blocks=XXX, imaxpct=PCT
|
||||
= sunit=XXX swidth=XXX, unwritten=X
|
||||
naming =VERN bsize=XXX
|
||||
log =LDEV bsize=XXX blocks=XXX
|
||||
realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
|
||||
*** compare logprint: 082.op with 082.fulldir/op.mnt-ologbsize=32k.mkfs-lversion=2.nosync.filtered
|
||||
*** compare logprint: 082.trans_inode with 082.fulldir/trans_inode.mnt-ologbsize=32k.mkfs-lversion=2.nosync.filtered
|
||||
*** compare logprint: 082.trans_buf with 082.fulldir/trans_buf.mnt-ologbsize=32k.mkfs-lversion=2.nosync.filtered
|
||||
--- mkfs=-lversion=2,su=4096, mnt=-ologbsize=32k, start=8, sync=nosync ---
|
||||
meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
|
||||
data = bsize=XXX blocks=XXX, imaxpct=PCT
|
||||
= sunit=XXX swidth=XXX, unwritten=X
|
||||
naming =VERN bsize=XXX
|
||||
log =LDEV bsize=XXX blocks=XXX
|
||||
realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
|
||||
*** compare logprint: 082.op with 082.fulldir/op.mnt-ologbsize=32k.mkfs-lversion=2,su=4096.nosync.filtered
|
||||
*** compare logprint: 082.trans_inode with 082.fulldir/trans_inode.mnt-ologbsize=32k.mkfs-lversion=2,su=4096.nosync.filtered
|
||||
*** compare logprint: 082.trans_buf with 082.fulldir/trans_buf.mnt-ologbsize=32k.mkfs-lversion=2,su=4096.nosync.filtered
|
||||
--- mkfs=-lversion=2,su=32768, mnt=-ologbsize=32k, start=64, sync=nosync ---
|
||||
meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
|
||||
data = bsize=XXX blocks=XXX, imaxpct=PCT
|
||||
= sunit=XXX swidth=XXX, unwritten=X
|
||||
naming =VERN bsize=XXX
|
||||
log =LDEV bsize=XXX blocks=XXX
|
||||
realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
|
||||
*** compare logprint: 082.op with 082.fulldir/op.mnt-ologbsize=32k.mkfs-lversion=2,su=32768.nosync.filtered
|
||||
*** compare logprint: 082.trans_inode with 082.fulldir/trans_inode.mnt-ologbsize=32k.mkfs-lversion=2,su=32768.nosync.filtered
|
||||
*** compare logprint: 082.trans_buf with 082.fulldir/trans_buf.mnt-ologbsize=32k.mkfs-lversion=2,su=32768.nosync.filtered
|
||||
--- mkfs=-lversion=2,su=36864, mnt=-ologbsize=32k, start=72, sync=nosync ---
|
||||
meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
|
||||
data = bsize=XXX blocks=XXX, imaxpct=PCT
|
||||
= sunit=XXX swidth=XXX, unwritten=X
|
||||
naming =VERN bsize=XXX
|
||||
log =LDEV bsize=XXX blocks=XXX
|
||||
realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
|
||||
mount failed: -ologbsize=32k
|
||||
(see 082.full for details)
|
||||
|
||||
*** mount failed: -ologbsize=32k ***
|
||||
|
||||
--- mkfs=-lversion=2,su=5120, mnt=-ologbsize=32k, start=10, sync=nosync ---
|
||||
|
||||
*** Cannot mkfs for this test using option specified: -lversion=2,su=5120 -lsize=2000b ***
|
||||
|
||||
*** unmount
|
||||
|
||||
@@ -0,0 +1,162 @@
|
||||
#! /bin/sh
|
||||
# XFS QA Test No. 086
|
||||
#
|
||||
# To test log replay with version 2 logs
|
||||
# Initially keep this simple with just creates.
|
||||
# In another qa test we can do more e.g. use fsstress.
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright (c) 2000-2004 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
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it would be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# Further, this software is distributed without any warranty that it is
|
||||
# free of the rightful claim of any third person regarding infringement
|
||||
# or the like. Any license provided herein, whether implied or
|
||||
# otherwise, applies only to this software file. Patent licenses, if
|
||||
# any, provided herein do not apply to combinations of this program with
|
||||
# other software, or any other product whatsoever.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write the Free Software Foundation, Inc., 59
|
||||
# Temple Place - Suite 330, Boston MA 02111-1307, USA.
|
||||
#
|
||||
# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
|
||||
# Mountain View, CA 94043, or:
|
||||
#
|
||||
# http://www.sgi.com
|
||||
#
|
||||
# For further information regarding this notice, see:
|
||||
#
|
||||
# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
|
||||
#-----------------------------------------------------------------------
|
||||
#
|
||||
# creator
|
||||
owner=root@icy.melbourne.sgi.com
|
||||
|
||||
seq=`basename $0`
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
|
||||
|
||||
# get standard environment, filters and checks
|
||||
. ./common.rc
|
||||
. ./common.filter
|
||||
. ./common.log
|
||||
|
||||
# real QA test starts here
|
||||
rm -f $seq.full $tmp.*
|
||||
_require_scratch
|
||||
|
||||
echo "*** init FS"
|
||||
umount $SCRATCH_DEV >/dev/null 2>&1
|
||||
|
||||
cat >$tmp.seq.params <<EOF
|
||||
# mkfs-opt mount-opt
|
||||
-lversion=2 -ologbsize=32k
|
||||
-lversion=2,su=4096 -ologbsize=32k
|
||||
-lversion=2,su=32768 -ologbsize=32k
|
||||
#
|
||||
# expect following line to fail
|
||||
#
|
||||
-lversion=2,su=36864 -ologbsize=32k
|
||||
#
|
||||
# following is not a power of 2 BBs
|
||||
#
|
||||
-lversion=2,su=5120 -ologbsize=32k
|
||||
EOF
|
||||
|
||||
# Do the work for various log params which
|
||||
# should not effect the data content of the log
|
||||
# Try with and without sync'ing - sync'ing will mean that
|
||||
# the log will be written out unfilled and thus the log
|
||||
# stripe can have an effect.
|
||||
#
|
||||
for s in sync nosync ; do
|
||||
cat $tmp.seq.params \
|
||||
| while read mkfs mnt restofline
|
||||
do
|
||||
if [ "$mkfs" = "#" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "--- mkfs=$mkfs, mnt=$mnt, sync=$s ---"
|
||||
export MOUNT_OPTIONS=$mnt
|
||||
export MKFS_OPTIONS=$mkfs
|
||||
|
||||
# mkfs the FS
|
||||
_echofull "mkfs"
|
||||
if ! _mkfs_log; then
|
||||
_echofull "mkfs failed: $MKFS_OPTIONS"
|
||||
continue
|
||||
fi
|
||||
|
||||
# mount the FS
|
||||
_echofull "mount"
|
||||
if ! _scratch_mount >>$seq.full 2>&1; then
|
||||
_echofull "mount failed: $MOUNT_OPTIONS"
|
||||
continue
|
||||
fi
|
||||
|
||||
# create the metadata
|
||||
if [ $s = "sync" ]; then
|
||||
# generate some log traffic - but not too much
|
||||
# add some syncs to get the log flushed to disk
|
||||
for file in $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}; do
|
||||
touch $file
|
||||
sync
|
||||
done
|
||||
else
|
||||
# generate some log traffic - but not too much - life gets a little
|
||||
# more complicated if the log wraps around. This traffic is
|
||||
# pretty much arbitary, but could probably be made better than this.
|
||||
touch $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
|
||||
fi
|
||||
|
||||
# check before on what FS should look like
|
||||
_echofull "ls $SCRATCH_MNT"
|
||||
ls $SCRATCH_MNT
|
||||
|
||||
_echofull "godown"
|
||||
src/godown -v -f $SCRATCH_MNT >> $seq.full
|
||||
|
||||
_echofull "unmount"
|
||||
umount $SCRATCH_DEV >>$seq.full 2>&1 \
|
||||
|| _fail "umount failed"
|
||||
|
||||
_echofull "logprint after going down..."
|
||||
_print_logstate
|
||||
|
||||
_echofull "mount with replay"
|
||||
_scratch_mount >>$seq.full 2>&1 \
|
||||
|| _fail "mount failed: $MOUNT_OPTIONS"
|
||||
|
||||
# check on what FS looks like after log recovery
|
||||
_echofull "ls $SCRATCH_MNT"
|
||||
ls $SCRATCH_MNT
|
||||
|
||||
_echofull "unmount"
|
||||
umount $SCRATCH_MNT
|
||||
|
||||
_echofull "logprint after mount and replay..."
|
||||
_print_logstate
|
||||
|
||||
if _check_scratch_fs; then
|
||||
_echofull "filesystem is checked ok"
|
||||
else
|
||||
_echofull "filesystem is NOT ok"
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
status=0
|
||||
exit
|
||||
+54
-77
@@ -56,6 +56,13 @@ _full()
|
||||
echo "" >>$seq.full
|
||||
}
|
||||
|
||||
_echofull()
|
||||
{
|
||||
echo "" | tee -a $seq.full
|
||||
echo "*** $* ***" | tee -a $seq.full
|
||||
echo "" | tee -a $seq.full
|
||||
}
|
||||
|
||||
# Handle the operations which get split over Log Record
|
||||
# boundaries.
|
||||
# Oper (379)..... flags: CONTINUE
|
||||
@@ -205,10 +212,21 @@ _check_log()
|
||||
| head | grep -q "<CLEAN>" || _fail "DIRTY LOG"
|
||||
}
|
||||
|
||||
_print_logstate()
|
||||
{
|
||||
_scratch_xfs_logprint -t | tee -a $seq.full >$tmp.logprint
|
||||
if grep -q "<DIRTY>" $tmp.logprint; then
|
||||
echo "dirty log"
|
||||
fi
|
||||
if grep -q "<CLEAN>" $tmp.logprint; then
|
||||
echo "clean log"
|
||||
fi
|
||||
}
|
||||
|
||||
_print_operation()
|
||||
{
|
||||
raw=$fulldir/op.mnt$mnt.mkfs$mkfs$sync_suffix.raw
|
||||
filtered=$fulldir/op.mnt$mnt.mkfs$mkfs$sync_suffix.filtered
|
||||
raw=$fulldir/op.mnt$MOUNT_OPTIONS.mkfs$MKFS_OPTIONS$sync_suffix.raw
|
||||
filtered=$fulldir/op.mnt$MOUNT_OPTIONS.mkfs$MKFS_OPTIONS$sync_suffix.filtered
|
||||
|
||||
echo "### xfs_logprint output ###" | tee $raw >$filtered
|
||||
_scratch_xfs_logprint -c 2>&1 \
|
||||
@@ -228,8 +246,8 @@ _print_operation()
|
||||
_print_transaction_inode()
|
||||
{
|
||||
_start=$1
|
||||
raw=$fulldir/trans_inode.mnt$mnt.mkfs$mkfs$sync_suffix.raw
|
||||
filtered=$fulldir/trans_inode.mnt$mnt.mkfs$mkfs$sync_suffix.filtered
|
||||
raw=$fulldir/trans_inode.mnt$MOUNT_OPTIONS.mkfs$MKFS_OPTIONS$sync_suffix.raw
|
||||
filtered=$fulldir/trans_inode.mnt$MOUNT_OPTIONS.mkfs$MKFS_OPTIONS$sync_suffix.filtered
|
||||
|
||||
echo "### xfs_logprint -t -i -s START output ###" | tee $raw >$filtered
|
||||
_scratch_xfs_logprint -t -i -s $_start 2>&1 \
|
||||
@@ -241,8 +259,8 @@ _print_transaction_inode()
|
||||
_print_transaction_buf()
|
||||
{
|
||||
_start=$1
|
||||
raw=$fulldir/trans_buf.mnt$mnt.mkfs$mkfs$sync_suffix.raw
|
||||
filtered=$fulldir/trans_buf.mnt$mnt.mkfs$mkfs$sync_suffix.filtered
|
||||
raw=$fulldir/trans_buf.mnt$MOUNT_OPTIONS.mkfs$MKFS_OPTIONS$sync_suffix.raw
|
||||
filtered=$fulldir/trans_buf.mnt$MOUNT_OPTIONS.mkfs$MKFS_OPTIONS$sync_suffix.filtered
|
||||
|
||||
echo "### xfs_logprint -t -b -s START output ###" | tee $raw >$filtered
|
||||
_scratch_xfs_logprint -t -b -s $_start 2>&1 \
|
||||
@@ -253,24 +271,16 @@ _print_transaction_buf()
|
||||
|
||||
_mkfs_log()
|
||||
{
|
||||
typeset _mkfs_opts
|
||||
_mkfs_opts=$1
|
||||
|
||||
# create the FS
|
||||
_full "mkfs"
|
||||
extra_ops="-lsize=2000b $_mkfs_opts"
|
||||
_scratch_mkfs_xfs $extra_ops >$tmp.mkfs0 2>&1
|
||||
[ $? -ne 0 ] && \
|
||||
_notrun "Cannot mkfs for this test using MKFS_OPTIONS specified: $MKFS_OPTIONS $extra_ops"
|
||||
cat $tmp.mkfs0 >>$seq.full
|
||||
extra_ops="-lsize=2000b"
|
||||
_scratch_mkfs_xfs $extra_ops >>$seq.full 2>&1
|
||||
if [ $? -ne 0 ] ; then
|
||||
_echofull "Cannot mkfs for this test using option specified: $MKFS_OPTIONS $extra_ops"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# check the mkfs settings
|
||||
_filter_mkfs <$tmp.mkfs0 2>$tmp.mkfs
|
||||
source $tmp.mkfs
|
||||
[ $dbsize -eq 4096 ] \
|
||||
|| _notrun "Logprint test, tailored to 4K blocks ($dbsize in use)"
|
||||
[ $isize -eq 256 ] \
|
||||
|| _notrun "Logprint test, tailored to 256b inodes ($isize in use)"
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
@@ -279,14 +289,13 @@ _mkfs_log()
|
||||
#
|
||||
_create_log()
|
||||
{
|
||||
typeset _mnt_opts
|
||||
|
||||
_mnt_opts=$1
|
||||
|
||||
# mount the FS
|
||||
_full " mount"
|
||||
_scratch_mount $_mnt_opts >>$seq.full 2>&1 \
|
||||
|| _fail "mount failed: $_mnt_opts $MOUNT_OPTIONS"
|
||||
_scratch_mount >>$seq.full 2>&1
|
||||
if [ $? -ne 0 ] ; then
|
||||
_echofull "mount failed: $MOUNT_OPTIONS"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# generate some log traffic - but not too much - life gets a little
|
||||
# more complicated if the log wraps around. This traffic is
|
||||
@@ -295,9 +304,13 @@ _create_log()
|
||||
|
||||
# unmount the FS
|
||||
_full "umount"
|
||||
umount $SCRATCH_DEV >>$seq.full 2>&1 \
|
||||
|| _fail "umount failed"
|
||||
umount $SCRATCH_DEV >>$seq.full 2>&1
|
||||
if [ $? -ne 0 ] ; then
|
||||
_echofull "umount failed"
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
#
|
||||
@@ -305,14 +318,13 @@ _create_log()
|
||||
#
|
||||
_create_log_sync()
|
||||
{
|
||||
typeset _mnt_opts
|
||||
|
||||
_mnt_opts=$1
|
||||
|
||||
# mount the FS
|
||||
_full " mount"
|
||||
_scratch_mount $_mnt_opts >>$seq.full 2>&1 \
|
||||
|| _fail "mount failed: $_mnt_opts $MOUNT_OPTIONS"
|
||||
_scratch_mount >>$seq.full 2>&1
|
||||
if [ $? -ne 0 ] ; then
|
||||
_echofull "mount failed: $MOUNT_OPTIONS"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# generate some log traffic - but not too much
|
||||
# add some syncs to get the log flushed to disk
|
||||
@@ -323,8 +335,11 @@ _create_log_sync()
|
||||
|
||||
# unmount the FS
|
||||
_full "umount"
|
||||
umount $SCRATCH_DEV >>$seq.full 2>&1 \
|
||||
|| _fail "umount failed"
|
||||
umount $SCRATCH_DEV >>$seq.full 2>&1
|
||||
if [ $? -ne 0 ] ; then
|
||||
_echofull "umount failed"
|
||||
return 1
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
@@ -332,47 +347,10 @@ _cmp_output()
|
||||
{
|
||||
echo "*** compare logprint: $1 with $2"
|
||||
if ! diff $1 $2 >/dev/null; then
|
||||
echo "FAILED: logprint output $1 differs to $2"
|
||||
touch $tmp.error
|
||||
_fail "logprint output $1 differs to $2"
|
||||
fi
|
||||
}
|
||||
|
||||
_clear_opts()
|
||||
{
|
||||
# clear opts
|
||||
# - remove the log options in mkfs
|
||||
# - remove the log options in mount
|
||||
# - remove the quota options in mount
|
||||
# leave any other options given
|
||||
# fix up removals when remaining -o or comma:
|
||||
# "-o blah," -> "-o blah"
|
||||
# "-o blah, -x woof" -> "-o blah -x woof"
|
||||
# "-x woof -o " -> "-x woof"
|
||||
# "-x woof -o -y wow" -> "-x woof -y wow"
|
||||
MKFS_OPTIONS=`echo $MKFS_OPTIONS | sed -e 's/-l[ ]*[^ $]*//g'`
|
||||
MOUNT_OPTIONS=`echo $MOUNT_OPTIONS |\
|
||||
sed \
|
||||
-e 's/logbsize=[^ ,]*,*//g' \
|
||||
-e 's/logbufs=[^ ,]*,*//g' \
|
||||
-e 's/usrquota,*//g' \
|
||||
-e 's/grpquota,*//g' \
|
||||
-e 's/quota,*//g' \
|
||||
-e 's/uqnoenforce,*//g' \
|
||||
-e 's/gqnoenforce,*//g' \
|
||||
-e 's/\(-o[^-,]*\), *$/\1/g' \
|
||||
-e 's/\(-o[^-,]*\), *-/\1 -/g' \
|
||||
-e 's/-o *$//g' \
|
||||
-e 's/-o *-/-/g' \
|
||||
`
|
||||
|
||||
# export opts
|
||||
export MKFS_OPTIONS
|
||||
export MOUNT_OPTIONS
|
||||
echo "MKFS_OPTIONS = $MKFS_OPTIONS" >>$seq.full
|
||||
echo "MOUNT_OPTIONS = $MOUNT_OPTIONS" >>$seq.full
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
# Op data of different Log Record sizes will mean that data is
|
||||
# split at different points and in op printing it will not
|
||||
@@ -432,8 +410,7 @@ _cmp_op_output()
|
||||
diff $1 $2 >$filtered.diff
|
||||
if ! _process_op_diff $filtered.diff
|
||||
then
|
||||
echo "FAILED: logprint output $1 differs to $2 considering splits"
|
||||
touch $tmp.error
|
||||
_fail "logprint output $1 differs to $2 considering splits"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user