fstests: move test group info to test files
[xfstests-dev.git] / tests / xfs / 423
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2017 Oracle, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 423
6 #
7 # Race scrubbing the inode record while appending to a file.
8 # This exposes a bug in xfs_bmap_count_blocks where we count delalloc
9 # extents for di_nblocks if the fork is in extents format, but we don't
10 # count them if the fork is in btree format.
11 #
12 . ./common/preamble
13 _begin_fstest dangerous_scrub
14
15 _register_cleanup "_cleanup" BUS
16
17 # Import common functions.
18 . ./common/filter
19 . ./common/fuzzy
20 . ./common/inject
21 . ./common/xfs
22
23 # real QA test starts here
24 _supported_fs xfs
25 _require_test_program "punch-alternating"
26 _require_xfs_io_command "scrub"
27 _require_xfs_io_command "falloc"
28 _require_scratch
29
30 echo "Format and populate"
31 _scratch_mkfs > "$seqres.full" 2>&1
32 _scratch_mount
33
34 $XFS_IO_PROG -f -c 'falloc 0 10m' $SCRATCH_MNT/a >> $seqres.full
35 $XFS_IO_PROG -f -c 'falloc 0 10m' $SCRATCH_MNT/b >> $seqres.full
36 $here/src/punch-alternating $SCRATCH_MNT/b
37 sync
38
39 echo "Set up delalloc extents"
40 $XFS_IO_PROG -c 'pwrite -S 0x66 10m 128k' $SCRATCH_MNT/a >> $seqres.full
41 $XFS_IO_PROG -c 'pwrite -S 0x66 10m 128k' $SCRATCH_MNT/b >> $seqres.full
42 $XFS_IO_PROG -c 'bmap -ev' $SCRATCH_MNT/a $SCRATCH_MNT/b > $SCRATCH_MNT/before
43 cat $SCRATCH_MNT/before >> $seqres.full
44
45 echo "Scrub a and b"
46 $XFS_IO_PROG -x -c 'scrub inode' $SCRATCH_MNT/a >> $seqres.full
47 $XFS_IO_PROG -x -c 'scrub inode' $SCRATCH_MNT/b >> $seqres.full
48 $XFS_IO_PROG -c 'bmap -ev' $SCRATCH_MNT/a $SCRATCH_MNT/b > $SCRATCH_MNT/after
49 cat $SCRATCH_MNT/after >> $seqres.full
50
51 echo "Compare extent maps"
52 diff -u $SCRATCH_MNT/before $SCRATCH_MNT/after
53
54 echo "Test done"
55 status=0
56 exit