2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2011 Red Hat. All Rights Reserved.
7 # Test fs creation on 4 TB minus few bytes partition
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
13 status=1 # failure is the default!
20 trap "_cleanup ; exit \$status" 0 1 2 3 15
22 # get standard environment, filters and checks
26 # real QA test starts here
33 testfile=$TEST_DIR/259.image
35 # Test various sizes slightly less than 4 TB. Need to handle different
36 # minimum block sizes for CRC enabled filesystems, but use a small log so we
37 # don't write lots of zeros unnecessarily.
38 sizes_to_check="4096 2048 1024 512"
39 blocksizes="4096 2048 1024 512"
40 four_TB=$(_math "2^42")
41 # The initial value of _fs_has_crcs is not important, because we start testing
42 # with 4096 block size, it only matters for 512 block size test
44 for del in $sizes_to_check; do
45 for bs in $blocksizes; do
46 echo "Trying to make (4TB - ${del}B) long xfs, block size $bs"
47 # skip tests with 512 block size if the fs created has crc
49 if [ $_fs_has_crcs -eq 1 -a $bs -eq 512 ]; then
52 ddseek=$(_math "$four_TB - $del")
54 dd if=/dev/zero "of=$testfile" bs=1 count=0 seek=$ddseek \
55 >/dev/null 2>&1 || echo "dd failed"
57 losetup $lofile "$testfile"
58 $MKFS_XFS_PROG -l size=32m -b size=$bs $lofile | _filter_mkfs \
59 >/dev/null 2> $tmp.mkfs || echo "mkfs failed!"