Fix some log offset calculations when version 2 logs are in use.
echo "*** reset partition"
$here/src/devzero -b 2048 -n 50 -v 198 $SCRATCH_DEV
echo "*** mkfs"
echo "*** reset partition"
$here/src/devzero -b 2048 -n 50 -v 198 $SCRATCH_DEV
echo "*** mkfs"
- lsize=2097152
- dsize=50m
- echo mkfs_xfs -dsize=$dsize -lsize=$lsize $SCRATCH_DEV >>$seq.full
- if ! mkfs_xfs -dsize=$dsize -lsize=$lsize $SCRATCH_DEV >>$seq.full 2>&1
- then
- echo "failed to mkfs $SCRATCH_DEV" >>$seq.full
- _notrun "mkfs cannot create scratch fs, probably too small log"
- exit 1
- fi
+ force_opts="-dsize=50m -lsize=2097152"
+ echo mkfs_xfs $force_opts $SCRATCH_DEV >>$seq.full
+ mkfs_xfs $force_opts $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
+ source $tmp.mkfs
}
# Get log stripe unit for v2 logs; if none specified,
}
# Get log stripe unit for v2 logs; if none specified,
-# (or v1 log) just return "1"
+# (or v1 log) just return "1" block
- echo $MKFS_OPTIONS | (grep sunit || echo "sunit=1") \
- | sed "s/.*sunit=\(.*\).*/\1/"
+ if [ $lsunit -eq 0 ]; then
+ echo $dbsize
+ else
+ expr $lsunit \* $dbsize
+ fi
[ $size -eq 4096 ] || \
_fail "!!! unexpected log size $size"
[ $head -eq 2 -o $head -eq $((lsunit/512)) ] || \
[ $size -eq 4096 ] || \
_fail "!!! unexpected log size $size"
[ $head -eq 2 -o $head -eq $((lsunit/512)) ] || \
- _fail "!!! unexpected initial log position $head"
+ _fail "!!! unexpected initial log position $head vs. $((lsunit/512))"
echo " lots of traffic" >>$seq.full
_log_traffic 850
echo " lots of traffic" >>$seq.full
_log_traffic 850
{
attr $* 2>$tmp.err >$tmp.out
exit=$?
{
attr $* 2>$tmp.err >$tmp.out
exit=$?
- sed -e "s#$SCRATCH_MNT[^ .:]*#<TESTFILE>#g; s#$tmp[^ :]*#<TMPFILE>#g;"\
+ sed \
+ -e "s#$SCRATCH_MNT[^ .:]*#<TESTFILE>#g" \
+ -e "s#$tmp[^ :]*#<TMPFILE>#g;" \
- sed -e "s#$SCRATCH_MNT[^ .:]*#<TESTFILE>#g; s#$tmp[^ :]*#<TMPFILE>#g;"\
+ sed \
+ -e "s#$SCRATCH_MNT[^ .:]*#<TESTFILE>#g" \
+ -e "s#$tmp[^ :]*#<TMPFILE>#g;" \
$tmp.err 1>&2
return $exit
}
$tmp.err 1>&2
return $exit
}
{
getfattr $* 2>$tmp.err >$tmp.out
exit=$?
{
getfattr $* 2>$tmp.err >$tmp.out
exit=$?
- sed -e "s#$SCRATCH_MNT[^ .:]*#<TESTFILE>#g; s#$tmp[^ :]*#<TMPFILE>#g;"\
+ sed \
+ -e "s#$SCRATCH_MNT[^ .:]*#<TESTFILE>#g" \
+ -e "s#$tmp[^ :]*#<TMPFILE>#g;" \
- sed -e "s#$SCRATCH_MNT[^ .:]*#<TESTFILE>#g; s#$tmp[^ :]*#<TMPFILE>#g;"\
+ sed \
+ -e "s#$SCRATCH_MNT[^ .:]*#<TESTFILE>#g" \
+ -e "s#$tmp[^ :]*#<TMPFILE>#g;" \
$tmp.err 1>&2
return $exit
}
$tmp.err 1>&2
return $exit
}
echo "*** mkfs"
mkfs_xfs $SCRATCH_DEV >/dev/null \
|| _fail "mkfs failed"
echo "*** mkfs"
mkfs_xfs $SCRATCH_DEV >/dev/null \
|| _fail "mkfs failed"
echo "*** mount FS"
mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >/dev/null \
|| _fail "mount failed"
echo "*** mount FS"
mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >/dev/null \
|| _fail "mount failed"
testfile=$SCRATCH_MNT/testfile
echo "*** make test file 1"
testfile=$SCRATCH_MNT/testfile
echo "*** make test file 1"
_getfattr --absolute-names $testfile.2
# print name and size from 1st line of output
_getfattr --absolute-names $testfile.2
# print name and size from 1st line of output
-_attr -g "a3" $testfile.2 | head -1
+_attr -g "a3" $testfile.2 > $tmp.hahahahaplonk
+head -1 $tmp.hahahahaplonk
+# NOTE:
+# Above goo works around some truly bizzaro sh/sed/head interaction
+# for some versions of these tools (fails on Redhat 7+, 6.2 worked)
# print out the rest of the data apart from the header
# the size is +1 for an extra \n at the end
# print out the rest of the data apart from the header
# the size is +1 for an extra \n at the end
s/log file: "([\w|\/.-]+)" daddr: (\d+) length: (\d+)/log device: LDEV daddr: XXX length: XXX/;
s/skipped (\w+) zeroed blocks/skipped XXX zeroed blocks/;
s/^uuid: *[0-9a-f-][0-9a-f-]* *format: *.*$/uuid: <UUID> format: <FORMAT>/;
s/log file: "([\w|\/.-]+)" daddr: (\d+) length: (\d+)/log device: LDEV daddr: XXX length: XXX/;
s/skipped (\w+) zeroed blocks/skipped XXX zeroed blocks/;
s/^uuid: *[0-9a-f-][0-9a-f-]* *format: *.*$/uuid: <UUID> format: <FORMAT>/;
+ s/(length of Log Record:) \d+/$1 <LEN>/;
s/version: \d/version: <VERN>/;
print;
'
s/version: \d/version: <VERN>/;
print;
'
log device: LDEV daddr: XXX length: XXX
cycle: 1 version: <VERN> lsn: 1,0 tail_lsn: 1,0
log device: LDEV daddr: XXX length: XXX
cycle: 1 version: <VERN> lsn: 1,0 tail_lsn: 1,0
-length of Log Record: 20 prev offset: -1 num ops: 1
+length of Log Record: <LEN> prev offset: -1 num ops: 1
uuid: <UUID> format: <FORMAT>
----------------------------------------------------------------------------
Oper (0): tid: b0c0d0d0 len: 8 clientid: LOG flags: UNMOUNT
uuid: <UUID> format: <FORMAT>
----------------------------------------------------------------------------
Oper (0): tid: b0c0d0d0 len: 8 clientid: LOG flags: UNMOUNT
postargs="" # for any special post-device options
# minix and msdos mkfs fails for large devices, restrict to 2000 blocks
postargs="" # for any special post-device options
# minix and msdos mkfs fails for large devices, restrict to 2000 blocks
- [ $fs = "minix" ] && postargs=2000
- [ $fs = "msdos" ] && postargs=2000
- # these folk prompt before writing
- [ $fs = "jfs" ] && preop="echo Y |"
- [ $fs = "reiserfs" ] && preop="echo y |"
+ [ $fs = minix ] && postargs=2000
+ [ $fs = msdos ] && postargs=2000
+ # these folks prompt before writing
+ [ $fs = jfs ] && preop="echo Y |"
+ [ $fs = reiserfs ] && preop="echo y |"
+ # cramfs mkfs requires a directory argument
+ [ $fs = cramfs ] && preargs=/proc/fs/xfs
# overwite the first few Kb - should blow away superblocks
src/devzero -n 20 $SCRATCH_DEV >/dev/null
# overwite the first few Kb - should blow away superblocks
src/devzero -n 20 $SCRATCH_DEV >/dev/null
mkdir ./bonnie || exit 1
defaults="-d ./bonnie -q -f -r 0"
mkdir ./bonnie || exit 1
defaults="-d ./bonnie -q -f -r 0"
- defaults="$default -u "`id -u`" -g "`id -g`
+ defaults="$defaults -u "`id -u`" -g "`id -g`
bonnie++ -m '' $defaults $@ >$tmp/bonnie.stdout 2>$tmp/bonnie.stderr
status=$?
rm -fr ./bonnie
bonnie++ -m '' $defaults $@ >$tmp/bonnie.stdout 2>$tmp/bonnie.stderr
status=$?
rm -fr ./bonnie