2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Oracle, Inc. All Rights Reserved.
7 # Check that cross-mountpoint reflink works.
10 _begin_fstest auto quick clone
12 _register_cleanup "_cleanup" BUS
14 # Override the default cleanup function.
22 # Import common functions.
26 # real QA test starts here
28 _require_scratch_reflink
31 echo "Format and mount"
32 _scratch_mkfs > $seqres.full 2>&1
33 _scratch_mount >> $seqres.full 2>&1
35 testdir=$SCRATCH_MNT/test-$seq
38 othertestdir=$otherdir/test-$seq
44 sz=$((blksz * blocks))
47 $MOUNT_PROG --bind $SCRATCH_MNT $otherdir
50 _pwrite_byte 0x61 0 $sz $testdir/file >> $seqres.full
54 _filter_scratch | sed -e "s,$otherdir,OTHER_DIR,g"
57 echo "Reflink one file to another"
58 _cp_reflink $testdir/file $othertestdir/otherfile 2>&1 | filter_otherdir
61 md5sum $testdir/file | _filter_scratch
62 md5sum $othertestdir/otherfile | filter_otherdir
64 echo "Unmount otherdir"
65 $UMOUNT_PROG $otherdir