Add copy_file_range() tests
Subsystems (2)
v5 cover Add copy_file_range() tests
These tests exercise the copy_file_range() system call, and check copying data to both a new file and overwriting data inside an existing file.
Sorry it took so long to get this version out. I forgot about these patches after the last submission.
Thanks,
Anna
Anna Schumaker (5):
generic/416: Add copy to new file test
generic/417: Add small copies to new file test generic/418: Add copy test that overwrites data generic/419: Add a copy test for overwriting small amounts of data generic/420: Add a copy test for invalid input
common/rc | 6 +++ tests/generic/416 | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/416.out | 26 +++++++++++++ tests/generic/417 | 83 ++++++++++++++++++++++++++++++++++++++++ tests/generic/417.out | 16 ++++++++ tests/generic/418 | 100 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/418.out | 17 +++++++++ tests/generic/419 | 87 ++++++++++++++++++++++++++++++++++++++++++ tests/generic/419.out | 17 +++++++++ tests/generic/420 | 76 +++++++++++++++++++++++++++++++++++++ tests/generic/420.out | 12 ++++++ tests/generic/group | 5 +++ 12 files changed, 547 insertions(+) create mode 100755 tests/generic/416 create mode 100644 tests/generic/416.out create mode 100755 tests/generic/417 create mode 100644 tests/generic/417.out create mode 100755 tests/generic/418 create mode 100644 tests/generic/418.out create mode 100755 tests/generic/419 create mode 100644 tests/generic/419.out create mode 100644 tests/generic/420 create mode 100644 tests/generic/420.out
Signature · 1 line
2.12.0
PATCH v5 1/5 generic/416: Add copy to new file test
This test copies data from various points in a source file to a new file. This is useful for testing the basics of copy_file_range().
--- common/rc | 6 +++ tests/generic/416 | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/416.out | 26 +++++++++++++ tests/generic/group | 1 + 4 files changed, 135 insertions(+) create mode 100755 tests/generic/416 create mode 100644 tests/generic/416.out
common/rc +6 -0
@@ -1976,6 +1976,12 @@ _require_xfs_io_command() "chproj") testio=`$XFS_IO_PROG -F -f -c "chproj 0" $testfile 2>&1` ;; + "copy_range") + testcopy=$TEST_DIR/$$.copy.xfs_io + $XFS_IO_PROG -F -f -c "pwrite 0 4k" $testfile 2>&1 > /dev/null + testio=`$XFS_IO_PROG -F -f -c "copy_range $testfile" $testcopy 2>&1` + rm -f $testcopy 2>&1 > /dev/null + ;; "falloc" ) testio=`$XFS_IO_PROG -F -f -c "falloc 0 1m" $testfile 2>&1` ;;
tests/generic/416 new file +102 -0
102 lines not on this page · raw message
tests/generic/416.out new file +26 -0
@@ -0,0 +1,26 @@ +QA output created by 416 +Create the original file and then copy +Original md5sums: +e11fbace556cba26bf0076e74cab90a3 TEST_DIR/test-416/file +e11fbace556cba26bf0076e74cab90a3 TEST_DIR/test-416/copy +Copy beginning of original file +md5sums after copying beginning: +e11fbace556cba26bf0076e74cab90a3 TEST_DIR/test-416/file +cabe45dcc9ae5b66ba86600cca6b8ba8 TEST_DIR/test-416/beginning +Copy middle of original file +md5sums after copying middle: +e11fbace556cba26bf0076e74cab90a3 TEST_DIR/test-416/file +4197de9da5badfc302715486b82bcdf1 TEST_DIR/test-416/middle +Copy end of original file +md5sums after copying end: +e11fbace556cba26bf0076e74cab90a3 TEST_DIR/test-416/file +e68d4a150c4e42f4f9ea3ffe4c9cf4ed TEST_DIR/test-416/end +Copy beyond end of original file +copy_range: Invalid argument +md5sums after copying beyond: +e11fbace556cba26bf0076e74cab90a3 TEST_DIR/test-416/file +e68d4a150c4e42f4f9ea3ffe4c9cf4ed TEST_DIR/test-416/beyond +Copy creates hole in target file +md5sums after creating hole: +e11fbace556cba26bf0076e74cab90a3 TEST_DIR/test-416/file +3ae9aef0992f8cb51c90c9a0ff2dd9d2 TEST_DIR/test-416/hole
tests/generic/group +1 -0
@@ -418,3 +418,4 @@ 413 auto quick 414 auto quick clone 415 auto clone +416 auto quick copy
Signature · 1 line
2.12.0
PATCH v5 2/5 generic/417: Add small copies to new file test
In reply to Anna SchumakerThis test copies single bytes from a source file into various new files just to make sure that we can handle very small copies.
--- tests/generic/417 | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/417.out | 16 ++++++++++ tests/generic/group | 1 + 3 files changed, 100 insertions(+) create mode 100755 tests/generic/417 create mode 100644 tests/generic/417.out
tests/generic/417 new file +83 -0
@@ -0,0 +1,83 @@ +#!/bin/bash +# FS QA Test No. 417 +# +# Tests vfs_copy_file_range(): +# - Copy a small file +# - Small copies from various points in the original file +#----------------------------------------------------------------------- +# Copyright (c) 2016 Netapp, Inc. All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment +. common/rc +. common/filter + +# real QA test starts here +_supported_fs generic +_supported_os Linux + +_require_xfs_io_command "copy_range" +_require_test + +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir +rm -f $seqres.full + +echo "Create the original file and then copy" +echo -n "abcde" > $testdir/file +$XFS_IO_PROG -f -c "copy_range $testdir/file" "$testdir/copy" +echo -n "abcde" | cmp $testdir/copy +echo "Original md5sums:" +md5sum $testdir/{file,copy} | _filter_test_dir + +echo "Small copies from various points in the original file" +$XFS_IO_PROG -f -c "copy_range -s 0 -l 1 $testdir/file" "$testdir/a" 2>&1 +$XFS_IO_PROG -f -c "copy_range -s 1 -l 1 $testdir/file" "$testdir/b" 2>&1 +$XFS_IO_PROG -f -c "copy_range -s 2 -l 1 $testdir/file" "$testdir/c" 2>&1 +$XFS_IO_PROG -f -c "copy_range -s 3 -l 1 $testdir/file" "$testdir/d" 2>&1 +$XFS_IO_PROG -f -c "copy_range -s 4 -l 1 $testdir/file" "$testdir/e" 2>&1 +$XFS_IO_PROG -f -c "copy_range -s 4 -l 1 -d 1 $testdir/file" "$testdir/f" 2>&1 +$XFS_IO_PROG -f -c "copy_range -s 5 -l 1 $testdir/file" "$testdir/g" 2>&1 +echo -n "a" | cmp $testdir/a +echo -n "b" | cmp $testdir/b +echo -n "c" | cmp $testdir/c +echo -n "d" | cmp $testdir/d +echo -n "e" | cmp $testdir/e +echo -en "\0e" | cmp $testdir/f +echo -n "" | cmp $testdir/g +echo "md5sums after small copies" +md5sum $testdir/{file,a,b,c,d,e,f,g} | _filter_test_dir + +#success, all done +status=0 +exit
tests/generic/417.out new file +16 -0
@@ -0,0 +1,16 @@ +QA output created by 417 +Create the original file and then copy +Original md5sums: +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-417/file +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-417/copy +Small copies from various points in the original file +copy_range: Invalid argument +md5sums after small copies +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-417/file +0cc175b9c0f1b6a831c399e269772661 TEST_DIR/test-417/a +92eb5ffee6ae2fec3ad71c777531578f TEST_DIR/test-417/b +4a8a08f09d37b73795649038408b5f33 TEST_DIR/test-417/c +8277e0910d750195b448797616e091ad TEST_DIR/test-417/d +e1671797c52e15f763380b45e841ec32 TEST_DIR/test-417/e +2015eb238d706eceefc784742928054f TEST_DIR/test-417/f +d41d8cd98f00b204e9800998ecf8427e TEST_DIR/test-417/g
tests/generic/group +1 -0
@@ -419,3 +419,4 @@ 414 auto quick clone 415 auto clone 416 auto quick copy +417 auto quick copy
Signature · 1 line
2.12.0
Re: [PATCH v5 2/5] generic/417: Add small copies to new file test
Quoted 3 lines · Anna Schumaker
This test copies single bytes from a source file into various new files just to make sure that we can handle very small copies.
Sorry for not following closely, but how is this supposed to work, I know that for FSs that support it a copy_file_range is supported by clone_file_range. But usually there are fs-block alignment restrictions on clone_file_range.
Does the VFS do the switch from fs->clone to generic-copy, or is the FS suppose to call the generic-copy?
Thanks
Boaz
Quoted 15 lines
Signed-off-by Anna Schumaker <[email protected]>--- tests/generic/417 | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/417.out | 16 ++++++++++ tests/generic/group | 1 + 3 files changed, 100 insertions(+) create mode 100755 tests/generic/417 create mode 100644 tests/generic/417.outtests/generic/417 new file +0
-0
tests/generic/417 line 8
Quoted 8 lines
tests/generic/417 new file +8
-0@@ -0,0 +1,83 @@ +#!/bin/bash +# FS QA Test No. 417 +# +# Tests vfs_copy_file_range(): +# - Copy a small file +# - Small copies from various points in the original file +#----------------------------------------------------------------------- +# Copyright (c) 2016 Netapp, Inc. All rights reserved.
<snip>
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to [email protected]
More majordomo info at https://urldefense.proofpoint.com/v2/url?u=http-3A__vger.kernel.org_majordomo-2Dinfo.html&d=DwICaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=-yMrTV4jriXR7ieyzzjV-QgHBD0UDw8ixoR77aMeAHE&m=v6FVYMUNASwMgvV3i2sddVYbdX0ODPC9Fuu8v9kZUHs&s=yOpV0LuEKSMkFKKeE9WLbKSs_cQW9yt6oLHL25DYhHY&e=
PATCH v5 3/5 generic/418: Add copy test that overwrites data
In reply to Anna SchumakerUsing copy to overwrite data in the destination file is perfectly valid, so let's make sure this case works as expected.
--- tests/generic/418 | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/418.out | 17 +++++++++ tests/generic/group | 1 + 3 files changed, 118 insertions(+) create mode 100755 tests/generic/418 create mode 100644 tests/generic/418.out
tests/generic/418 new file +100 -0
@@ -0,0 +1,100 @@ +#!/bin/bash +# FS QA Test No. 418 +# +# Tests vfs_copy_file_range(): +# - Copy a file +# - Use copy to swap data at beginning and end +# - Use copy to swap data in the middle +# - Use copy to simultaneously overwrite and append to destination file +#----------------------------------------------------------------------- +# Copyright (c) 2016 Netapp, Inc. All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment +. common/rc +. common/filter + +# real QA test starts here +_supported_fs generic +_supported_os Linux + +_require_xfs_io_command "copy_range" +_require_test + +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir +rm -f $seqres.full + +echo "Create the original file and then copy" +$XFS_IO_PROG -f -c 'pwrite -S 0x61 0 1000' $testdir/file >> $seqres.full 2>&1 +$XFS_IO_PROG -f -c 'pwrite -S 0x62 1000 1000' $testdir/file >> $seqres.full 2>&1 +$XFS_IO_PROG -f -c 'pwrite -S 0x63 2000 1000' $testdir/file >> $seqres.full 2>&1 +$XFS_IO_PROG -f -c 'pwrite -S 0x64 3000 1000' $testdir/file >> $seqres.full 2>&1 +$XFS_IO_PROG -f -c 'pwrite -S 0x65 4000 1000' $testdir/file >> $seqres.full 2>&1 +$XFS_IO_PROG -f -c "copy_range $testdir/file" "$testdir/copy" +cmp $testdir/file $testdir/copy +echo "Original md5sums:" +md5sum $testdir/{file,copy} | _filter_test_dir + +echo "Swap beginning and end of original file" +$XFS_IO_PROG -f -c "copy_range -s 4000 -l 1000 $testdir/file" "$testdir/copy" 2>&1 +$XFS_IO_PROG -f -c "copy_range -d 4000 -l 1000 $testdir/file" "$testdir/copy" 2>&1 +cmp -n 1000 $testdir/file $testdir/copy 4000 +cmp -n 3000 $testdir/file $testdir/copy 1000 1000 +cmp -n 1000 $testdir/file $testdir/copy 0 4000 +echo "md5sums after swapping beginning and end:" +md5sum $testdir/{file,copy} | _filter_test_dir + +echo "Swap middle parts of original file" +$XFS_IO_PROG -f -c "copy_range -s 1000 -d 3000 -l 1000 $testdir/file" "$testdir/copy" 2>&1 +$XFS_IO_PROG -f -c "copy_range -s 3000 -d 1000 -l 1000 $testdir/file" "$testdir/copy" 2>&1 +cmp -n 1000 $testdir/file $testdir/copy 4000 +cmp -n 1000 $testdir/file $testdir/copy 3000 1000 +cmp -n 1000 $testdir/file $testdir/copy 2000 2000 +cmp -n 1000 $testdir/file $testdir/copy 1000 3000 +cmp -n 1000 $testdir/file $testdir/copy 0 4000 +echo "md5sums after swapping middle:" +md5sum $testdir/{file,copy} | _filter_test_dir + +echo "Copy tail of original file onto copy" +$XFS_IO_PROG -f -c "copy_range -s 1000 -d 3000 -l 4000 $testdir/file" "$testdir/copy" 2>&1 +cmp -n 1000 $testdir/file $testdir/copy 4000 +cmp -n 1000 $testdir/file $testdir/copy 3000 1000 +cmp -n 1000 $testdir/file $testdir/copy 2000 2000 +cmp -n 4000 $testdir/file $testdir/copy 1000 3000 +echo "md5sums after copying tail:" +md5sum $testdir/{file,copy} | _filter_test_dir + +#success, all done +status=0 +exit
tests/generic/418.out new file +17 -0
@@ -0,0 +1,17 @@ +QA output created by 418 +Create the original file and then copy +Original md5sums: +e11fbace556cba26bf0076e74cab90a3 TEST_DIR/test-418/file +e11fbace556cba26bf0076e74cab90a3 TEST_DIR/test-418/copy +Swap beginning and end of original file +md5sums after swapping beginning and end: +e11fbace556cba26bf0076e74cab90a3 TEST_DIR/test-418/file +5f4e111811dd9a810143c9db9bec6d80 TEST_DIR/test-418/copy +Swap middle parts of original file +md5sums after swapping middle: +e11fbace556cba26bf0076e74cab90a3 TEST_DIR/test-418/file +8c81889a5a50b311197110bcf769a695 TEST_DIR/test-418/copy +Copy tail of original file onto copy +md5sums after copying tail: +e11fbace556cba26bf0076e74cab90a3 TEST_DIR/test-418/file +e5fbacd993eaa5e80ebc2b14b969887d TEST_DIR/test-418/copy
tests/generic/group +1 -0
@@ -420,3 +420,4 @@ 415 auto clone 416 auto quick copy 417 auto quick copy +418 auto quick copy
Signature · 1 line
2.12.0
PATCH v5 4/5 generic/419: Add a copy test for overwriting small amounts of data
In reply to Anna SchumakerThis test is similar to 345, except that it copies one byte at a time to make sure that this case works as expected.
--- tests/generic/419 | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/419.out | 17 ++++++++++ tests/generic/group | 1 + 3 files changed, 105 insertions(+) create mode 100755 tests/generic/419 create mode 100644 tests/generic/419.out
tests/generic/419 new file +87 -0
@@ -0,0 +1,87 @@ +#!/bin/bash +# FS QA Test No. 419 +# +# Tests vfs_copy_file_range(): +# - Copy a small file +# - Use copy to swap data at beginning and end +# - Use copy to swap data in the middle +# - Use copy to swap data in a small file +#----------------------------------------------------------------------- +# Copyright (c) 2016 Netapp, Inc. All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment +. common/rc +. common/filter + +# real QA test starts here +_supported_fs generic +_supported_os Linux + +_require_xfs_io_command "copy_range" +_require_test + +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir +rm -f $seqres.full + +echo "Create the original file and then copy" +echo -n "abcde" > $testdir/file +$XFS_IO_PROG -f -c "copy_range $testdir/file" "$testdir/copy" 2>&1 +cmp $testdir/file $testdir/copy +echo "Original md5sums:" +md5sum $testdir/{file,copy} | _filter_test_dir + +echo "Swap beginning and end of original file" +$XFS_IO_PROG -f -c "copy_range -s 0 -d 4 -l 1 $testdir/file" "$testdir/copy" 2>&1 +$XFS_IO_PROG -f -c "copy_range -s 4 -d 0 -l 1 $testdir/file" "$testdir/copy" 2>&1 +echo -n "ebcda" | cmp $testdir/copy +echo "md5sums after swapping beginning and end:" +md5sum $testdir/{file,copy} | _filter_test_dir + +echo "Swap middle parts of original file" +$XFS_IO_PROG -f -c "copy_range -s 1 -d 3 -l 1 $testdir/file" "$testdir/copy" 2>&1 +$XFS_IO_PROG -f -c "copy_range -s 3 -d 1 -l 1 $testdir/file" "$testdir/copy" 2>&1 +echo -n "edcba" | cmp $testdir/copy +echo "md5sums after swapping middle:" +md5sum $testdir/{file,copy} | _filter_test_dir + +echo "Copy tail of original file onto copy" +$XFS_IO_PROG -f -c "copy_range -s 1 -d 3 -l 4 $testdir/file" "$testdir/copy" 2>&1 +echo -n "edcbcde" | cmp $testdir/copy +echo "md5sums after copying tail:" +md5sum $testdir/{file,copy} | _filter_test_dir + +#success, all done +status=0 +exit
tests/generic/419.out new file +17 -0
@@ -0,0 +1,17 @@ +QA output created by 419 +Create the original file and then copy +Original md5sums: +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-419/file +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-419/copy +Swap beginning and end of original file +md5sums after swapping beginning and end: +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-419/file +32db1f6d06d15f7e38e1ab1c69da498a TEST_DIR/test-419/copy +Swap middle parts of original file +md5sums after swapping middle: +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-419/file +295228f3d82d344bbcf2f0030519c2ea TEST_DIR/test-419/copy +Copy tail of original file onto copy +md5sums after copying tail: +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-419/file +0c4aac952f72fa078e2f8419aca70b28 TEST_DIR/test-419/copy
tests/generic/group +1 -0
@@ -421,3 +421,4 @@ 416 auto quick copy 417 auto quick copy 418 auto quick copy +419 auto quick copy
Signature · 1 line
2.12.0
PATCH v5 5/5 generic/420: Add a copy test for invalid input
In reply to Anna SchumakerThis test passes invalid argumnt combinations to the copy_file_range() system call to test that input is verified before attempting to copy.
--- tests/generic/420 | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/420.out | 12 ++++++++ tests/generic/group | 1 + 3 files changed, 89 insertions(+) create mode 100644 tests/generic/420 create mode 100644 tests/generic/420.out
tests/generic/420 new file +76 -0
@@ -0,0 +1,76 @@ +#!/bin/bash +# FS QA Test No. 420 +# +# Tests vfs_copy_file_range() error checking +#----------------------------------------------------------------------- +# Copyright (c) 2016 Netapp, Inc. All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment +. common/rc +. common/filter + +# real QA test starts here +_supported_fs generic +_supported_os Linux + +_require_xfs_io_command "copy_range" +_require_test + +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir +rm -f $seqres.full + +echo "Create the original files" +$XFS_IO_PROG -f -c 'pwrite -S 0x61 0 1000' $testdir/file >> $seqres.full 2>&1 +mknod $testdir/dev1 c 1 3 +mkfifo $testdir/fifo + +echo "Try to copy when source pos > source size" +$XFS_IO_PROG -f -c "copy_range -s 1000 -l 100 $testdir/file" "$testdir/copy" 2>&1 + +echo "Try to copy to a read-only file" +$XFS_IO_PROG -r -f -c "copy_range -s 0 -l 100 $testdir/file" "$testdir/copy" 2>&1 + +echo "Try to copy to an append-only file" +$XFS_IO_PROG -a -f -c "copy_range -s 0 -l 100 $testdir/file" "$testdir/copy" 2>&1 + +echo "Try to copy to a device" +$XFS_IO_PROG -a -f -c "copy_range -s 0 -l 100 $testdir/file" "$testdir/dev1" 2>&1 + +echo "Try to copy to a fifo" +$XFS_IO_PROG -a -f -c "copy_range -s 0 -l 100 $testdir/file" "$testdir/fifo" 2>&1 + +#success, all done +status=0 +exit
tests/generic/420.out new file +12 -0
@@ -0,0 +1,12 @@ +QA output created by 420 +Create the original files +Try to copy when source pos > source size +copy_range: Invalid argument +Try to copy to a read-only file +copy_range: Bad file descriptor +Try to copy to an append-only file +copy_range: Bad file descriptor +Try to copy to a device +copy_range: Invalid argument +Try to copy to a fifo +copy_range: Invalid argument
tests/generic/group +1 -0
@@ -422,3 +422,4 @@ 417 auto quick copy 418 auto quick copy 419 auto quick copy +420 auto quick copy
Signature · 1 line
2.12.0
Quoted 5 lines · Anna Schumaker
These tests exercise the
copy_file_range()system call, and check copying data to both a new file and overwriting data inside an existing file.Sorry it took so long to get this version out. I forgot about these patches after the last submission.
Hooray, tests finally!
I had to bump the numbers up due to conflicts (it's usually best to pick a really high number and let Eryu mvtest them to their real numbers), but these mostly look ok.
However, I do see that something isn't triggering an EINVAL return code:
generic/816 - output mismatch (see /tmp/xfstests/results//generic/816.out.bad)
--- tests/generic/816.out 2017-03-17 14:46:21.064521899 -0700
+++ /tmp/xfstests/results//generic/816.out.bad 2017-03-17 14:58:15.848000000 -0700
@@ -16,7 +16,6 @@
e11fbace556cba26bf0076e74cab90a3 TEST_DIR/test-816/file
e68d4a150c4e42f4f9ea3ffe4c9cf4ed TEST_DIR/test-816/end
Copy beyond end of original file
-copy_range: Invalid argument
md5sums after copying beyond:
e11fbace556cba26bf0076e74cab90a3 TEST_DIR/test-816/file
e68d4a150c4e42f4f9ea3ffe4c9cf4ed TEST_DIR/test-816/beyond
...
(Run 'diff -u tests/generic/816.out /tmp/xfstests/results//generic/816.out.bad' to see the entire diff)
generic/817 - output mismatch (see /tmp/xfstests/results//generic/817.out.bad)
--- tests/generic/817.out 2017-03-17 14:47:02.916437143 -0700
+++ /tmp/xfstests/results//generic/817.out.bad 2017-03-17 14:58:17.168000000 -0700
@@ -4,7 +4,6 @@
ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-817/file
ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-817/copy
Small copies from various points in the original file
-copy_range: Invalid argument
md5sums after small copies
ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-817/file
0cc175b9c0f1b6a831c399e269772661 TEST_DIR/test-817/a
...
(Run 'diff -u tests/generic/817.out /tmp/xfstests/results//generic/817.out.bad' to see the entire diff)
generic/818 1s
generic/819 1s
generic/820 - output mismatch (see /tmp/xfstests/results//generic/820.out.bad) --- tests/generic/820.out 2017-03-17 14:47:44.140338654 -0700
+++ /tmp/xfstests/results//generic/820.out.bad 2017-03-17 14:58:21.120000000 -0700
@@ -1,7 +1,6 @@
QA output created by 820
Create the original files
Try to copy when source pos > source size
-copy_range: Invalid argument
Try to copy to a read-only file
copy_range: Bad file descriptor
Try to copy to an append-only file
...
(Run 'diff -u tests/generic/820.out /tmp/xfstests/results//generic/820.out.bad' to see the entire diff)
Running 4.11-rc2 here with a ton of XFS patches, though these results are from an FSTYP=ext4 run. FSTYP=xfs produces the same diff output.
--D
Quoted 43 lines
Thanks,
AnnaAnna Schumaker (5):
generic/416: Add copy to new file test
generic/417: Add small copies to new file test generic/418: Add copy test that overwrites data generic/419: Add a copy test for overwriting small amounts of data generic/420: Add a copy test for invalid inputcommon/rc | 6 +++ tests/generic/416 | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/416.out | 26 +++++++++++++ tests/generic/417 | 83 ++++++++++++++++++++++++++++++++++++++++ tests/generic/417.out | 16 ++++++++ tests/generic/418 | 100 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/418.out | 17 +++++++++ tests/generic/419 | 87 ++++++++++++++++++++++++++++++++++++++++++ tests/generic/419.out | 17 +++++++++ tests/generic/420 | 76 +++++++++++++++++++++++++++++++++++++ tests/generic/420.out | 12 ++++++ tests/generic/group | 5 +++ 12 files changed, 547 insertions(+) create mode 100755 tests/generic/416 create mode 100644 tests/generic/416.out create mode 100755 tests/generic/417 create mode 100644 tests/generic/417.out create mode 100755 tests/generic/418 create mode 100644 tests/generic/418.out create mode 100755 tests/generic/419 create mode 100644 tests/generic/419.out create mode 100644 tests/generic/420 create mode 100644 tests/generic/420.outSignature · 6 lines
2.12.0 -- To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines · Darrick J. Wong
Quoted 3 lines · Anna Schumaker
These tests exercise the
copy_file_range()system call, and check copying data to both a new file and overwriting data inside an existing file.
Quoted 8 lines
Quoted 2 lines
Sorry it took so long to get this version out. I forgot about these patches after the last submission.
Hooray, tests finally!
I had to bump the numbers up due to conflicts (it's usually best to pick a really high number and let Eryu mvtest them to their real numbers), but these mostly look ok.
Usually the test numbers are not a problem, as long as the patchset is based on latest master and there's no test number conflicts :)
Overall the tests look fine to me too.
Quoted 2 lines
However, I do see that something isn't triggering an EINVAL return code:
Same results here, tested with xfs/ext4/btrfs on 4.11-rc2 kernel.
And another nitpick is the year in copyright, s/2016/2017/ ?
Thanks,
Eryu
Quoted 17 lines · Eryu Guan
Quoted 4 lines · Darrick J. Wong
Quoted 3 lines · Anna Schumaker
These tests exercise the
copy_file_range()system call, and check copying data to both a new file and overwriting data inside an existing file.Quoted 8 lines
Quoted 2 lines
Sorry it took so long to get this version out. I forgot about these patches after the last submission.
Hooray, tests finally!
I had to bump the numbers up due to conflicts (it's usually best to pick a really high number and let Eryu mvtest them to their real numbers), but these mostly look ok.
Usually the test numbers are not a problem, as long as the patchset is based on latest master and there's no test number conflicts :)
Quoted 8 lines
Overall the tests look fine to me too.
Quoted 2 lines
However, I do see that something isn't triggering an EINVAL return code:
Same results here, tested with xfs/ext4/btrfs on 4.11-rc2 kernel.
And another nitpick is the year in copyright, s/2016/2017/ ?
Another month, another kernel release... can we please get these tests fixed and integrated?
--D
Quoted 7 lines
Thanks,
Eryu
--
To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 21 lines · Darrick J. Wong
Quoted 20 lines · Eryu Guan
Quoted 4 lines · Darrick J. Wong
Quoted 3 lines · Anna Schumaker
These tests exercise the
copy_file_range()system call, and check copying data to both a new file and overwriting data inside an existing file.Quoted 8 lines
Quoted 2 lines
Sorry it took so long to get this version out. I forgot about these patches after the last submission.
Hooray, tests finally!
I had to bump the numbers up due to conflicts (it's usually best to pick a really high number and let Eryu mvtest them to their real numbers), but these mostly look ok.
Usually the test numbers are not a problem, as long as the patchset is based on latest master and there's no test number conflicts :)
Overall the tests look fine to me too.
Quoted 1 line
Quoted 9 lines
Quoted 5 lines
Quoted 1 line
However, I do see that something isn't triggering an EINVAL return code:
Same results here, tested with xfs/ext4/btrfs on 4.11-rc2 kernel.
And another nitpick is the year in copyright, s/2016/2017/ ?
Another month, another kernel release... can we please get these tests fixed and integrated?
I'm curious when you say "testing with btrfs" does it mean NFS server exporting btrfs or does it mean just local btrfs?
Quoted 13 lines
--D
Quoted 7 lines
Thanks,
Eryu
--
To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 26 lines · Olga Kornievskaia
Quoted 25 lines · Darrick J. Wong
Quoted 24 lines · Eryu Guan
Quoted 4 lines · Darrick J. Wong
Quoted 3 lines · Anna Schumaker
These tests exercise the
copy_file_range()system call, and check copying data to both a new file and overwriting data inside an existing file.Quoted 8 lines
Quoted 2 lines
Sorry it took so long to get this version out. I forgot about these patches after the last submission.
Hooray, tests finally!
I had to bump the numbers up due to conflicts (it's usually best to pick a really high number and let Eryu mvtest them to their real numbers), but these mostly look ok.
Usually the test numbers are not a problem, as long as the patchset is based on latest master and there's no test number conflicts :)
Overall the tests look fine to me too.
Quoted 2 lines
However, I do see that something isn't triggering an EINVAL return code:
Same results here, tested with xfs/ext4/btrfs on 4.11-rc2 kernel.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
And another nitpick is the year in copyright, s/2016/2017/ ?
Another month, another kernel release... can we please get these tests fixed and integrated?
I'm curious when you say "testing with btrfs" does it mean NFS server exporting btrfs or does it mean just local btrfs?
Local btrfs, xfs, and ext4.
--D
Quoted 14 lines
Quoted 14 lines
--D
Quoted 7 lines
Thanks,
Eryu
--
To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html