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 _begin_fstest auto quick rw
17 # Import common functions.
20 # real QA test starts here
24 _scratch_mkfs >>$seqres.full 2>&1
29 echo "++ Create the original files" >> $seqres.full
30 bigoff=$(echo "2^63 - 2" | $BC_PROG)
31 len=$(echo "2^63 - 1" | $BC_PROG)
32 $XFS_IO_PROG -f -c "truncate $len" $testdir/file0 >> $seqres.full 2>&1
33 if [ ! -s $testdir/file0 ]; then
34 # If we can't set a large file size then don't bother
35 # with read/write tests, because fs doesn't support it.
36 _notrun "filesystem does not support huge file size"
38 _pwrite_byte 0x61 $bigoff 1 $testdir/file1 >> $seqres.full
40 echo "++ Check file creation" >> $seqres.full
43 $XFS_IO_PROG -c "pread -v -q $bigoff 1" $testdir/file1