2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Red Hat Inc. All Rights Reserved.
7 # Test copy up files from lower dir that are <, =, > 4G in size.
9 # Kernel commit 0480334fa604 ("ovl: use O_LARGEFILE in ovl_copy_up()")
10 # fixed bug when copying up large file from lower dir.
13 seqres=$RESULT_DIR/$seq
14 echo "QA output created by $seq"
18 status=1 # failure is the default!
19 trap "_cleanup; exit \$status" 0 1 2 3 15
27 # get standard environment, filters and checks
31 # remove previous $seqres.full before test
34 # real QA test starts here
39 # Remove all files from previous tests
42 # overlay copy_up doesn't deal with sparse file well, holes will be filled by
43 # zeros, so at least (4G + 4G + 8k) free space is needed on scratch base fs
44 _require_fs_space $OVL_BASE_SCRATCH_MNT $((4*1024*1024*2 + 8))
46 # Create test files with different sizes in lower dir
47 lowerdir=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
49 touch $lowerdir/zero_size
50 $XFS_IO_PROG -fc "pwrite 0 4k" $lowerdir/less_than_4g >>$seqres.full
51 $XFS_IO_PROG -fc "pwrite 4294963200 4k" $lowerdir/4gfile >>$seqres.full
52 $XFS_IO_PROG -fc "pwrite 4g 4k" $lowerdir/larger_than_4g >>$seqres.full
56 echo "Silence is golden"
58 # Open the files should succeed, no errors are expected (e.g. EFBIG)
59 for f in $SCRATCH_MNT/*; do
60 $XFS_IO_PROG -c "open" $f >>$seqres.full