blob: fd71d1e390902abd1dae47c87521a424b216d763 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2018 Red Hat, Inc. All Rights Reserved.
#
# FS QA Test No. 565
#
# Exercise copy_file_range() across devices supported by some
# filesystems since kernel commit:
#
# 5dae222a5ff0 vfs: allow copy_file_range to copy across devices
#
. ./common/preamble
_begin_fstest auto quick copy_range
_register_cleanup "_cleanup" BUS
# Import common functions.
. ./common/filter
# real QA test starts here
_supported_fs generic
_require_test
_require_scratch
_require_xfs_io_command "copy_range"
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount
testdir=$TEST_DIR/test-$seq
rm -rf $testdir
mkdir $testdir
$XFS_IO_PROG -f -c "pwrite -S 0x61 0 128k" $testdir/file >> $seqres.full 2>&1
# expect success or EXDEV on filesystem/kernel that do not support
# cross-device copy_range
testio=`$XFS_IO_PROG -f -c "copy_range -l 128k $testdir/file" $SCRATCH_MNT/copy 2>&1`
echo $testio | grep -q "cross-device" && \
_notrun "$FSTYP does not support cross-device copy_file_range"
echo -n $testio
cmp $testdir/file $SCRATCH_MNT/copy
echo "md5sums after xdev copy:"
md5sum $testdir/file $SCRATCH_MNT/copy | _filter_testdir_and_scratch
# success, all done
status=0
exit
|