2 # FS QA Test 074-extsz-hints-vs-maxextlen
4 # Check some extent size hint boundary conditions that can result in
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2015 Red Hat, Inc. All Rights Reserved.
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License as
12 # published by the Free Software Foundation.
14 # This program is distributed in the hope that it would be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write the Free Software Foundation,
21 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 #-----------------------------------------------------------------------
27 seqres=$RESULT_DIR/$seq
28 echo "QA output created by $seq"
33 _destroy_loop_device $LOOP_DEV
34 rm -f $tmp.* $LOOP_FILE
39 status=1 # failure is the default!
40 trap "_cleanup; exit \$status" 0 1 2 3 15
42 # get standard environment, filters and checks
46 # real QA test starts here
53 _require_xfs_io_command "falloc"
55 # we use loop devices for this so that we can create large files for prealloc
56 # without having to care about the underlying device size.
59 LOOP_FILE=$TEST_DIR/$seq.img
60 LOOP_MNT=$TEST_DIR/$seq.mnt
62 $XFS_IO_PROG -ft -c "truncate 1t" $LOOP_FILE >> $seqres.full
63 LOOP_DEV=`_create_loop_device $LOOP_FILE`
65 _mkfs_dev -d size=156452m,agcount=4 -l size=32m $LOOP_DEV
66 _mount $LOOP_DEV $LOOP_MNT
68 # Corrupt the BMBT by creating extents larger than MAXEXTLEN
72 $LOOP_MNT/foo >> $seqres.full
75 _check_xfs_filesystem $LOOP_DEV none none
77 _mkfs_dev -f -l size=32m $LOOP_DEV
78 _mount $LOOP_DEV $LOOP_MNT
80 # check we trim both ends of the extent approproiately; this will fail
81 # on 1k block size filesystems without the correct fixes in place.
84 -c "falloc 1023m 2g" \
85 $LOOP_MNT/foo >> $seqres.full
88 _check_xfs_filesystem $LOOP_DEV none none
91 echo "Silence is golden"