xfs/005: sync superblock modification to disk before mount test
authorEric Sandeen <sandeen@redhat.com>
Mon, 29 Sep 2014 02:55:54 +0000 (12:55 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 29 Sep 2014 02:55:54 +0000 (12:55 +1000)
This test tries to directly corrupt the CRC field of the primary
superblock by using xfs_io pwrite, but never syncs it to disk,
so it's quite likely that the mount will not see the bad data.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
tests/xfs/005

index 5d4534b0226bc0a48cc211b070178a03b526e864..fade4bbf282b38d6efd8dc39b1e32c7fc038f856 100755 (executable)
@@ -61,7 +61,7 @@ rm -f $seqres.full
 _scratch_mkfs_xfs -m crc=1 >> $seqres.full 2>&1 || _fail "mkfs failed"
 
 # Zap the crc.  xfs_db updates the CRC post-write, so poke it directly
-$XFS_IO_PROG -c "pwrite 224 4" $SCRATCH_DEV | _filter_xfs_io
+$XFS_IO_PROG -c "pwrite 224 4" -c fsync $SCRATCH_DEV | _filter_xfs_io
 
 # should FAIL, the crc is bad; golden output contains mount failure
 _scratch_mount 2>&1 | filter_mount