2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2017, Oracle and/or its affiliates.
4 # Copyright (C) 2019, CTERA Networks.
9 # Check that high-offset reads and writes work.
11 # This is a variant of test generic/466 for filesystems that
12 # do not support mkfs_sized.
15 seqres=$RESULT_DIR/$seq
16 echo "QA output created by $seq"
20 status=1 # failure is the default!
21 trap "_cleanup; exit \$status" 0 1 2 3 15
29 # get standard environment, filters and checks
33 # real QA test starts here
40 _scratch_mkfs >>$seqres.full 2>&1
45 echo "++ Create the original files" >> $seqres.full
46 bigoff=$(echo "2^63 - 2" | $BC_PROG)
47 len=$(echo "2^63 - 1" | $BC_PROG)
48 $XFS_IO_PROG -f -c "truncate $len" $testdir/file0 >> $seqres.full 2>&1
49 if [ ! -s $testdir/file0 ]; then
50 # If we can't set a large file size then don't bother
51 # with read/write tests, because fs doesn't support it.
52 _notrun "filesystem does not support huge file size"
54 _pwrite_byte 0x61 $bigoff 1 $testdir/file1 >> $seqres.full
56 echo "++ Check file creation" >> $seqres.full
59 $XFS_IO_PROG -c "pread -v -q $bigoff 1" $testdir/file1