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 _begin_fstest log metadata auto
12 # Import common functions.
15 # real QA test starts here
19 _scratch_mkfs_xfs >/dev/null 2>&1
21 # 16T mkfs requires a bit over 2G free
22 _require_fs_space $SCRATCH_MNT 2202000
25 LOOP_DEV=$SCRATCH_MNT/test_fs
26 LOOP_MNT=$SCRATCH_MNT/test_fs_dir
31 echo -n "fssize=${i}g "
32 $MKFS_XFS_PROG -f -b size=4096 -l version=2 \
33 -d name=$LOOP_DEV,size=${i}g |grep log
34 mount -o loop -t xfs $LOOP_DEV $LOOP_MNT
35 echo "test write" > $LOOP_MNT/test
36 umount $LOOP_MNT > /dev/null 2>&1
38 # punch out the previous blocks so that we keep the amount of
39 # disk space the test requires down to a minimum.
40 $XFS_IO_PROG -f -c "unresvsp 0 16383g" $LOOP_DEV
43 # make large holey file
44 $XFS_IO_PROG -f -c "truncate 16383g" $LOOP_DEV
46 #make loopback mount dir
49 # test if large logs are supported
50 $MKFS_XFS_PROG -f -l size=256m -d name=$LOOP_DEV,size=10g > /dev/null 2>&1
52 _notrun "large log sizes not supported by mkfs"
56 # walk over "new" sizes supported by recent xfsprogs.
57 # Note that the last test is for 16TB-1GB as 32bit platforms only support
58 # device slightly smaller than 16TB.
60 _do_mkfs 512 1024 2048 4096 8192 16383