5 # Test if mkfs.xfs wipes old AG headers when using -f option
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2007 Silicon Graphics, Inc. All Rights Reserved.
9 #-----------------------------------------------------------------------
12 owner=mohamedb@sgi.com
15 echo "QA output created by $seq"
19 status=1 # failure is the default!
20 trap "_cleanup; exit \$status" 0 1 2 3 15
27 # dd the 1st sector then repair
31 dd if=/dev/zero of=$1 bs=$2 count=1 2>&1 | _filter_dd
33 _scratch_xfs_repair 2>&1 | _filter_repair
35 if _check_scratch_fs; then
42 # get standard environment, filters and checks
47 # real QA test starts here
49 # Modify as appropriate.
54 # o Summary of testing:
55 # 1. mkfs.xfs a default filesystem, note agcount value.
56 # 2. dd zero first sector and repair and verify.
57 # 3. mkfs.xfs overriding agcount to a smaller value
58 # (ie. each AG is bigger)
59 # 4. dd zero first sector, repair and verify.
60 # -> old mkfs.xfs will cause repair to incorrectly
61 # fix filesystem, new mkfs.xfs will be fine.
64 _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs \
65 || _fail "mkfs failed!"
67 # By executing the followint tmp file, will get on the mkfs options stored in
71 [ $agcount -le 2 ] && _notrun "Test requires more than 2 AGs."
73 _dd_repair_check $SCRATCH_DEV $sectsz
76 let "agcount=$agcount-2"
77 _scratch_mkfs_xfs -dagcount=$agcount >/dev/null 2>&1 \
78 || _fail "mkfs failed!"
80 _dd_repair_check $SCRATCH_DEV $sectsz