reflink: ensure that we can handle reflinking a lot of extents
[xfstests-dev.git] / tests / generic / 096
1 #! /bin/bash
2 # FS QA Test 096
3 #
4 # Exercise the situation that cause ext4 to BUG_ON() when we use
5 # zero range to zero a range which starts within the isize but ends
6 # past the isize but still in the same block. This particular problem
7 # has only been seen on systems with page_size > block_size.
8 #
9 #-----------------------------------------------------------------------
10 # Copyright (c) 2015 Red Hat, Inc., Lukas Czerner <lczerner@redhat.com>
11 #
12 # This program is free software; you can redistribute it and/or
13 # modify it under the terms of the GNU General Public License as
14 # published by the Free Software Foundation.
15 #
16 # This program is distributed in the hope that it would be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 # GNU General Public License for more details.
20 #
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write the Free Software Foundation,
23 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
24 #-----------------------------------------------------------------------
25 #
26
27 seq=`basename $0`
28 seqres=$RESULT_DIR/$seq
29 echo "QA output created by $seq"
30
31 here=`pwd`
32 tmp=/tmp/$$
33 status=1        # failure is the default!
34 trap "_cleanup; exit \$status" 0 1 2 3 15
35
36 _cleanup()
37 {
38         cd /
39         rm -f $tmp.*
40 }
41
42 # get standard environment, filters and checks
43 . ./common/rc
44 . ./common/filter
45
46 # real QA test starts here
47 _supported_fs generic
48 _supported_os IRIX Linux
49 _require_scratch
50 _require_xfs_io_command "fzero"
51
52 rm -f $seqres.full
53 echo "Silence is golden"
54
55 # Use smaller scratch fs to shorten the test time
56 _scratch_mkfs_sized $((512 * 1024 * 1024)) >>$seqres.full 2>&1
57 _scratch_mount
58
59 testfile=$SCRATCH_MNT/$seq.$$
60 $XFS_IO_PROG -f -c "pwrite 4096 512" -c "fzero 4351 512" $testfile >> $seqres.full 2>&1
61
62 # success, all done
63 status=0
64 exit