blob: b052376f0e0ccf2960882b6a5e81c74f102da69f [file] [log] [blame]
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2020 Christian Kujau. All Rights Reserved.
# Copyright (c) 2020 Ritesh Harjani. All Rights Reserved.
#
# FS QA Test generic/620
#
# Since the test is not specific to ext4, hence adding it to generic.
#
# Add this test to check for regression which was reported when ext4 bmap aops
# was moved to use iomap APIs. jbd2 calls bmap() kernel function from
# fs/inode.c which was failing since iomap_bmap() implementation earlier
# returned 0 for block addr > INT_MAX.
#
# This regression was fixed with following kernel commit commit b75dfde1212
# ("fibmap: Warn and return an error in case of block > INT_MAX")
#
. ./common/preamble
_begin_fstest auto mount quick
# Override the default cleanup function.
_cleanup()
{
_dmhugedisk_cleanup
cd /
rm -f $tmp.*
}
# Import common functions.
. ./common/filter
. ./common/dmhugedisk
# Modify as appropriate.
_supported_fs generic
_require_scratch_size_nocheck $((4 * 1024 * 1024)) #kB
_require_scratch_16T_support
_require_dmhugedisk
# 17TB dm huge-test-zer0 device
# (in terms of 512 sectors)
sectors=$((2*1024*1024*1024*17))
chunk_size=128
_dmhugedisk_init $sectors $chunk_size
_mkfs_dev $DMHUGEDISK_DEV
_mount $DMHUGEDISK_DEV $SCRATCH_MNT || _fail "mount failed for $DMHUGEDISK_DEV $SCRATCH_MNT"
testfile=$SCRATCH_MNT/testfile-$seq
$XFS_IO_PROG -fc "pwrite -S 0xaa 0 1m" -c "fsync" $testfile | _filter_xfs_io
# success, all done
status=0
exit