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
33 _scratch_mkfs_xfs >/dev/null 2>&1
35 # 16T mkfs requires a bit over 2G free
36 _require_fs_space $SCRATCH_MNT 2202000
39 LOOP_DEV=$SCRATCH_MNT/test_fs
40 LOOP_MNT=$SCRATCH_MNT/test_fs_dir
45 echo -n "fssize=${i}g "
46 $MKFS_XFS_PROG -f -b size=4096 -l version=2 \
47 -d name=$LOOP_DEV,size=${i}g |grep log
48 mount -o loop -t xfs $LOOP_DEV $LOOP_MNT
49 echo "test write" > $LOOP_MNT/test
50 umount $LOOP_MNT > /dev/null 2>&1
52 # punch out the previous blocks so that we keep the amount of
53 # disk space the test requires down to a minimum.
54 $XFS_IO_PROG -f -c "unresvsp 0 16383g" $LOOP_DEV
57 # make large holey file
58 $XFS_IO_PROG -f -c "truncate 16383g" $LOOP_DEV
60 #make loopback mount dir
63 # test if large logs are supported
64 $MKFS_XFS_PROG -f -l size=256m -d name=$LOOP_DEV,size=10g > /dev/null 2>&1
66 _notrun "large log sizes not supported by mkfs"
70 # walk over "new" sizes supported by recent xfsprogs.
71 # Note that the last test is for 16TB-1GB as 32bit platforms only support
72 # device slightly smaller than 16TB.
74 _do_mkfs 512 1024 2048 4096 8192 16383