mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
This change makes test 041 function correctly other blocks sizes, not just 4096.
The FS bsize is extracted from _filter_mkfs and then used to calculate growfs "destination" size. Merge of master-melb:xfs-cmds:28222a by kenmcd. calculate one meg in blocks, then use that value to calculate grow-to values.
This commit is contained in:
@@ -51,19 +51,21 @@ rm -f $seq.full
|
|||||||
agsize=32
|
agsize=32
|
||||||
echo -n "Make $agsize megabyte filesystem on SCRATCH_DEV and mount... "
|
echo -n "Make $agsize megabyte filesystem on SCRATCH_DEV and mount... "
|
||||||
_scratch_mkfs_xfs -dsize=${agsize}m,agcount=1 2>&1 >/dev/null || _fail "mkfs failed"
|
_scratch_mkfs_xfs -dsize=${agsize}m,agcount=1 2>&1 >/dev/null || _fail "mkfs failed"
|
||||||
|
bsize=`_scratch_mkfs_xfs -dsize=${agsize}m,agcount=1 2>&1 | _filter_mkfs 2>&1 \
|
||||||
|
| perl -ne 'if (/dbsize=(\d+)/) {print $1;}'`
|
||||||
|
onemeginblocks=`expr 1048576 / $bsize`
|
||||||
_scratch_mount || _fail "mount failed"
|
_scratch_mount || _fail "mount failed"
|
||||||
|
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|
||||||
# full allocation group -> partial; partial -> expand partial + new partial;
|
# full allocation group -> partial; partial -> expand partial + new partial;
|
||||||
# partial -> expand partial; partial -> full
|
# partial -> expand partial; partial -> full
|
||||||
# 17 -> 33 -> 35 -> 48 megabytes, converted to fs blocks below
|
# cycle through 33m -> 67m -> 75m -> 96m
|
||||||
# for size in 4352 8448 8960 12288
|
for size in 33 67 75 96
|
||||||
# 33 -> 67 -> 75 -> 96 converted to fs blocks:
|
|
||||||
for size in 8448 17512 19200 24576
|
|
||||||
do
|
do
|
||||||
|
grow_size=`expr $size \* $onemeginblocks`
|
||||||
_fill $SCRATCH_MNT/fill_$size
|
_fill $SCRATCH_MNT/fill_$size
|
||||||
_do "Grow filesystem to $size blocks" "xfs_growfs -D ${size} $SCRATCH_MNT"
|
_do "Grow filesystem to ${size}m" "xfs_growfs -D $grow_size $SCRATCH_MNT"
|
||||||
echo -n "Flush filesystem... "
|
echo -n "Flush filesystem... "
|
||||||
_do "umount $SCRATCH_MNT"
|
_do "umount $SCRATCH_MNT"
|
||||||
_do "_scratch_mount"
|
_do "_scratch_mount"
|
||||||
@@ -73,7 +75,7 @@ do
|
|||||||
echo "fail (see $seq.full)"
|
echo "fail (see $seq.full)"
|
||||||
_do "cat $tmp.manifest"
|
_do "cat $tmp.manifest"
|
||||||
_do "ls -altrR $SCRATCH_MNT"
|
_do "ls -altrR $SCRATCH_MNT"
|
||||||
_do "dd if=$SCRATCH_DEV bs=4096 count=$size | gzip -9 > $seq.fsimage.gz"
|
_do "dd if=$SCRATCH_DEV bs=4096 count=$grow_size | gzip -9 > $seq.fsimage.gz"
|
||||||
status=1 ; exit
|
status=1 ; exit
|
||||||
fi
|
fi
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
QA output created by 041
|
QA output created by 041
|
||||||
Make 32 megabyte filesystem on SCRATCH_DEV and mount... done
|
Make 32 megabyte filesystem on SCRATCH_DEV and mount... done
|
||||||
Fill filesystem... done
|
Fill filesystem... done
|
||||||
Grow filesystem to 8448 blocks... done
|
Grow filesystem to 33m... done
|
||||||
Flush filesystem... done
|
Flush filesystem... done
|
||||||
Check files... done
|
Check files... done
|
||||||
Fill filesystem... done
|
Fill filesystem... done
|
||||||
Grow filesystem to 17512 blocks... done
|
Grow filesystem to 67m... done
|
||||||
Flush filesystem... done
|
Flush filesystem... done
|
||||||
Check files... done
|
Check files... done
|
||||||
Fill filesystem... done
|
Fill filesystem... done
|
||||||
Grow filesystem to 19200 blocks... done
|
Grow filesystem to 75m... done
|
||||||
Flush filesystem... done
|
Flush filesystem... done
|
||||||
Check files... done
|
Check files... done
|
||||||
Fill filesystem... done
|
Fill filesystem... done
|
||||||
Grow filesystem to 24576 blocks... done
|
Grow filesystem to 96m... done
|
||||||
Flush filesystem... done
|
Flush filesystem... done
|
||||||
Check files... done
|
Check files... done
|
||||||
Growfs tests passed.
|
Growfs tests passed.
|
||||||
|
|||||||
Reference in New Issue
Block a user