2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Oracle, Inc. All Rights Reserved.
7 # Check that cross-mountpoint reflink doesn't work.
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 7 15
25 # get standard environment, filters and checks
30 # real QA test starts here
33 _require_scratch_reflink
36 echo "Format and mount"
37 _scratch_mkfs > $seqres.full 2>&1
38 _scratch_mount >> $seqres.full 2>&1
40 testdir=$SCRATCH_MNT/test-$seq
43 othertestdir=$otherdir/test-$seq
49 sz=$((blksz * blocks))
52 $MOUNT_PROG --bind $SCRATCH_MNT $otherdir
55 _pwrite_byte 0x61 0 $sz $testdir/file >> $seqres.full
59 _filter_scratch | sed -e "s,$otherdir,OTHER_DIR,g"
62 echo "Reflink one file to another"
63 _cp_reflink $testdir/file $othertestdir/otherfiles 2>&1 | filter_md5
66 md5sum $testdir/file | _filter_scratch
67 test -e $othertestdir/otherfile && echo "otherfile should not exist"
69 echo "Unmount otherdir"
70 $UMOUNT_PROG $otherdir