2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2015, Oracle and/or its affiliates. All Rights Reserved.
7 # Ensure that we can't reflink realtime files.
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
21 umount $SCRATCH_MNT > /dev/null 2>&1
22 rm -rf $tmp.* $testdir $metadump_file
25 # get standard environment, filters and checks
30 # real QA test starts here
33 _require_scratch_reflink
38 echo "Format and mount scratch device"
39 _scratch_mkfs >> $seqres.full
42 testdir=$SCRATCH_MNT/test-$seq
45 echo "Create the original file blocks"
47 $XFS_IO_PROG -R -f -c "truncate $blksz" $testdir/file1
49 echo "Reflink every block"
50 _cp_reflink $testdir/file1 $testdir/file2 2>&1 | _filter_scratch
52 test -s $testdir/file2 && _fail "Should not be able to reflink a realtime file."