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 _begin_fstest auto quick clone realtime
12 # Override the default cleanup function.
16 umount $SCRATCH_MNT > /dev/null 2>&1
17 rm -rf $tmp.* $testdir $metadump_file
20 # Import common functions.
24 # real QA test starts here
27 _require_scratch_reflink
30 echo "Format and mount scratch device"
31 _scratch_mkfs >> $seqres.full
34 testdir=$SCRATCH_MNT/test-$seq
37 echo "Create the original file blocks"
39 $XFS_IO_PROG -R -f -c "truncate $blksz" $testdir/file1
41 echo "Reflink every block"
42 _cp_reflink $testdir/file1 $testdir/file2 2>&1 | _filter_scratch
44 test -s $testdir/file2 && _fail "Should not be able to reflink a realtime file."