summaryrefslogtreecommitdiff
path: root/tests/generic/620
blob: b052376f0e0ccf2960882b6a5e81c74f102da69f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#! /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