4 # Test that a bad crc on a primary V5 superblock will fail the mount
6 # 10e6e65 xfs: be more forgiving of a v4 secondary sb w/ junk in v5 fields
7 # inadvertently caused primary SB CRC failures to not error out, this
8 # is a regression test for that fix.
10 #-----------------------------------------------------------------------
11 # Copyright (c) 2014 Red Hat, Inc. All Rights Reserved.
13 # This program is free software; you can redistribute it and/or
14 # modify it under the terms of the GNU General Public License as
15 # published by the Free Software Foundation.
17 # This program is distributed in the hope that it would be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write the Free Software Foundation,
24 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 #-----------------------------------------------------------------------
29 seqres=$RESULT_DIR/$seq
30 echo "QA output created by $seq"
34 status=1 # failure is the default!
35 trap "_cleanup; exit \$status" 0 1 2 3 15
43 # get standard environment, filters and checks
47 # Modify as appropriate.
51 _require_scratch_nocheck
56 _scratch_mkfs_xfs -m crc=1 >> $seqres.full 2>&1 || _fail "mkfs failed"
58 # Zap the crc. xfs_db updates the CRC post-write, so poke it directly
59 $XFS_IO_PROG -c "pwrite 224 4" -c fsync $SCRATCH_DEV | _filter_xfs_io
61 # should FAIL, the crc is bad; golden output contains mount failure
62 _try_scratch_mount 2>&1 | _filter_error_mount