2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved.
7 # large log size mkfs test - ensure the log size scaling works
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
24 # get standard environment, filters and checks
28 # real QA test starts here
32 _scratch_mkfs_xfs >/dev/null 2>&1
34 # 16T mkfs requires a bit over 2G free
35 _require_fs_space $SCRATCH_MNT 2202000
38 LOOP_DEV=$SCRATCH_MNT/test_fs
39 LOOP_MNT=$SCRATCH_MNT/test_fs_dir
44 echo -n "fssize=${i}g "
45 $MKFS_XFS_PROG -f -b size=4096 -l version=2 \
46 -d name=$LOOP_DEV,size=${i}g |grep log
47 mount -o loop -t xfs $LOOP_DEV $LOOP_MNT
48 echo "test write" > $LOOP_MNT/test
49 umount $LOOP_MNT > /dev/null 2>&1
51 # punch out the previous blocks so that we keep the amount of
52 # disk space the test requires down to a minimum.
53 $XFS_IO_PROG -f -c "unresvsp 0 16383g" $LOOP_DEV
56 # make large holey file
57 $XFS_IO_PROG -f -c "truncate 16383g" $LOOP_DEV
59 #make loopback mount dir
62 # test if large logs are supported
63 $MKFS_XFS_PROG -f -l size=256m -d name=$LOOP_DEV,size=10g > /dev/null 2>&1
65 _notrun "large log sizes not supported by mkfs"
69 # walk over "new" sizes supported by recent xfsprogs.
70 # Note that the last test is for 16TB-1GB as 32bit platforms only support
71 # device slightly smaller than 16TB.
73 _do_mkfs 512 1024 2048 4096 8192 16383