4 # Test that garbage in old v4 superblocks doesn't trip verifiers during growfs
6 # Older kernels sometimes left garbage in the unused portions
7 # of the superblock during growfs; with the new verifiers this initially
8 # caused failures during a subsequent growfs; see
9 # 10e6e65 xfs: be more forgiving of a v4 secondary sb w/ junk in v5 fields
10 # for further explanation. (NB: while the commit log was good, the
11 # patch had a bug which was subsequently fixed)
13 #-----------------------------------------------------------------------
14 # Copyright (c) 2014 Red Hat, Inc. All Rights Reserved.
16 # This program is free software; you can redistribute it and/or
17 # modify it under the terms of the GNU General Public License as
18 # published by the Free Software Foundation.
20 # This program is distributed in the hope that it would be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 # GNU General Public License for more details.
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write the Free Software Foundation,
27 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 #-----------------------------------------------------------------------
32 seqres=$RESULT_DIR/$seq
33 echo "QA output created by $seq"
37 status=1 # failure is the default!
38 trap "_cleanup; exit \$status" 0 1 2 3 15
46 # get standard environment, filters and checks
50 # Modify as appropriate.
55 # So we can explicitly turn it _off_:
60 _scratch_mkfs_xfs -m crc=0 -d size=128m >> $seqres.full 2>&1 || _fail "mkfs failed"
62 # Scribble past a couple V4 secondary superblocks to populate sb_crc
63 # (We can't write to the structure member because it doesn't exist
64 # on a v4 superblock, so we use the data type & "write fill")
65 $XFS_DB_PROG -x -c "sb 1" -c "type data" -c "write fill 0xff 224 4" $SCRATCH_DEV
66 $XFS_DB_PROG -x -c "sb 2" -c "type data" -c "write fill 0xff 224 4" $SCRATCH_DEV
71 $XFS_GROWFS_PROG $SCRATCH_MNT >> $seqres.full 2>&1 || _fail "growfs failed"