2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Red Hat Inc. All Rights Reserved.
7 # Test mkfs against thin provision device, which has very small backing size,
8 # mkfs should return error when it hits EIO.
11 _begin_fstest auto mkfs thin
13 # Initialize dmthin device with very small backing size & very big virtual
14 # size, with the hope that mkfs hit EIO at mkfs time
15 BACKING_SIZE=$((1 * 1024 * 1024 / 512)) # 1M
16 VIRTUAL_SIZE=$((1 * 1024 * 1024 * 1024 * 1024 / 512)) # 1T
18 # Override the default cleanup function.
26 # Import common functions.
30 # real QA test starts here
32 # $SCRATCH_DEV won't be directly created filesystem on, so fsck isn't required
33 _require_scratch_nocheck
34 _require_dm_target thin-pool
36 _dmthin_init $BACKING_SIZE $VIRTUAL_SIZE
38 # try mkfs on dmthin device, expect mkfs failure if 1M isn't big enough to hold
39 # all the metadata. But if mkfs returns success, we expect the filesystem is
40 # consistent, make sure it doesn't currupt silently.
41 $MKFS_PROG -t $FSTYP $DMTHIN_VOL_DEV >>$seqres.full 2>&1
46 echo "Silence is golden"