4 # Test fs creation on 4 TB minus few bytes partition
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2011 Red Hat. All Rights Reserved.
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation.
13 # This program is distributed in the hope that it would be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write the Free Software Foundation,
20 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #-----------------------------------------------------------------------
26 seqres=$RESULT_DIR/$seq
27 echo "QA output created by $seq"
29 status=1 # failure is the default!
36 trap "_cleanup ; exit \$status" 0 1 2 3 15
38 # get standard environment, filters and checks
42 # real QA test starts here
49 testfile=$TEST_DIR/259.image
51 # Test various sizes slightly less than 4 TB. Need to handle different
52 # minimum block sizes for CRC enabled filesystems, but use a small log so we
53 # don't write lots of zeros unnecessarily.
54 sizes_to_check="4096 2048 1024 512"
55 blocksizes="4096 2048 1024 512"
56 four_TB=$(_math "2^42")
57 # The initial value of _fs_has_crcs is not important, because we start testing
58 # with 4096 block size, it only matters for 512 block size test
60 for del in $sizes_to_check; do
61 for bs in $blocksizes; do
62 echo "Trying to make (4TB - ${del}B) long xfs, block size $bs"
63 # skip tests with 512 block size if the fs created has crc
65 if [ $_fs_has_crcs -eq 1 -a $bs -eq 512 ]; then
68 ddseek=$(_math "$four_TB - $del")
70 dd if=/dev/zero "of=$testfile" bs=1 count=0 seek=$ddseek \
71 >/dev/null 2>&1 || echo "dd failed"
73 losetup $lofile "$testfile"
74 $MKFS_XFS_PROG -l size=32m -b size=$bs $lofile | _filter_mkfs \
75 >/dev/null 2> $tmp.mkfs || echo "mkfs failed!"