2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2020 Christian Kujau. All Rights Reserved.
4 # Copyright (c) 2020 Ritesh Harjani. All Rights Reserved.
6 # FS QA Test generic/620
8 # Since the test is not specific to ext4, hence adding it to generic.
10 # Add this test to check for regression which was reported when ext4 bmap aops
11 # was moved to use iomap APIs. jbd2 calls bmap() kernel function from
12 # fs/inode.c which was failing since iomap_bmap() implementation earlier
13 # returned 0 for block addr > INT_MAX.
15 # This regression was fixed with following kernel commit commit b75dfde1212
16 # ("fibmap: Warn and return an error in case of block > INT_MAX")
19 seqres=$RESULT_DIR/$seq
20 echo "QA output created by $seq"
24 status=1 # failure is the default!
25 trap "_cleanup; exit \$status" 0 1 2 3 15
34 # get standard environment, filters and checks
39 # remove previous $seqres.full before test
42 # Modify as appropriate.
44 _require_scratch_16T_support
45 _require_scratch_size_nocheck $((4 * 1024 * 1024)) #kB
48 # 17TB dm huge-test-zer0 device
49 # (in terms of 512 sectors)
50 sectors=$((2*1024*1024*1024*17))
53 _dmhugedisk_init $sectors $chunk_size
54 _mkfs_dev $DMHUGEDISK_DEV
55 _mount $DMHUGEDISK_DEV $SCRATCH_MNT || _fail "mount failed for $DMHUGEDISK_DEV $SCRATCH_MNT"
56 testfile=$SCRATCH_MNT/testfile-$seq
58 $XFS_IO_PROG -fc "pwrite -S 0xaa 0 1m" -c "fsync" $testfile | _filter_xfs_io