Merge of master-melb:xfs-cmds:30689a by kenmcd.
Force the agcount to 6 to keep behaviour the same as old and new
_link_out_file $seq.out
# nuke the superblock, AGI, AGF, AGFL; then try repair the damage
-#
+#
_check_ag()
{
for structure in 'sb 0' 'agf 0' 'agi 0' 'agfl 0'
_require_nobigloopfs
_require_scratch
-DSIZE="-dsize=100m"
+DSIZE="-dsize=100m,agcount=6"
# first we need to ensure there are no bogus secondary
# superblocks between the primary and first secondary
_supported_fs xfs
_supported_os Linux
-# Must have loop device
+# Must have loop device
_require_loop
LOOP_DEV=$TEST_DIR/$seq.fs
new_size=$2
bsize=$3
check=$4
+ agsize=$5
+
+ dparam="file,name=$LOOP_DEV,size=$original"
+ if [ -n "$agsize" ]; then
+ dparam="$dparam,agsize=$agsize"
+ fi
echo
echo "=== GROWFS (from $original to $new_size, $bsize blocksize)"
echo
echo "*** mkfs loop file (size=$original)"
- /sbin/mkfs.xfs -bsize=$bsize -dfile,name=$LOOP_DEV,size=$original \
+ $MKFS_XFS_PROG -b size=$bsize -d $dparam \
| _filter_mkfs 2>/dev/null
echo "*** extend loop file"
echo "*** grow loop filesystem"
#xfs_growfs $LOOP_MNT 2>&1 | grep -e "^data" #| _filter_growfs 2>/dev/null
- xfs_growfs $LOOP_MNT 2>&1 | _filter_growfs 2>&1
+ $XFS_GROWFS_PROG $LOOP_MNT 2>&1 | _filter_growfs 2>&1
echo "*** unmount"
umount $LOOP_MNT
# Large grows takes forever to check..
- if [ "$check" -gt "0" ]
+ if [ "$check" -gt "0" ]
then
echo "*** check"
_check_xfs_filesystem $LOOP_DEV none none
# Some other blocksize cases...
_grow_loop 168024b 1376452608 2048 1
-_grow_loop 168024b 1376452608 512 1
+_grow_loop 168024b 1376452608 512 1 16m
_grow_loop 168024b 688230400 1024 1
rm -f $tmp.*
}
# dd the 1st sector then repair
-_dd_repair_check()
+_dd_repair_check()
{
#dd first sector
dd if=/dev/zero of=$1 bs=$2 count=1 2>&1 | _filter_dd
#xfs_repair
- _scratch_xfs_repair 2>&1 | _filter_repair
+ _scratch_xfs_repair 2>&1 | _filter_repair
#check repair
if _check_scratch_fs; then
echo "repair passed"
# real QA test starts here
# Modify as appropriate.
-_supported_fs xfs
+_supported_fs xfs
_supported_os Linux
# From the PV
# o Summary of testing:
# 1. mkfs.xfs a default filesystem, note agcount value.
# 2. dd zero first sector and repair and verify.
-# 3. mkfs.xfs overriding agcount to a smaller value
+# 3. mkfs.xfs overriding agcount to a smaller value
# (ie. each AG is bigger)
# 4. dd zero first sector, repair and verify.
# -> old mkfs.xfs will cause repair to incorrectly
_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs \
|| _fail "mkfs failed!"
-# By executing the followint tmp file, will get on the mkfs options stored in
+# By executing the followint tmp file, will get on the mkfs options stored in
# variables
. $tmp.mkfs
-[ $agcount -le 2 ] && _notrun "Test requires more than 2 AGs."
+# if the default agcount is too small, bump it up and re-mkfs before testing
+if [ $agcount -lt 8 ]; then
+ agcount=8
+ _scratch_mkfs_xfs -dagcount=$agcount >/dev/null 2>&1 \
+ || _notrun "Test requires at least 8 AGs."
+fi
_dd_repair_check $SCRATCH_DEV $sectsz