xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls
v4 cover xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls
Hi all,
This is a small patch set against the reflink/dedupe test cases in xfstests. The first patch is a rewrite of the tools to find the lowest vacant ID number and to move a test case. These two programs are useful for staging a lot of new tests at a high number and moving them to lower numbers when the maintainer wants to accept the new tests.
The second patch fixes some reflink tests that didn't clean up after themselves.
Patch 3 updates the golden output for the test that examines the results of feeding bad inputs to the two ioctls. The new error values are based on a discussion of how to react to bad file types on the mailing lists and the ongoing work to hoist the ioctls to the VFS level.
Patches 4-5 fix some minor errors found while testing with different kernel config and block size options.
Patch 6 introduces new tests to check the behavior of unaligned CoW, punch-while-CoWd, and ensures that passing len == 0 to reflink actually runs to EOF.
Patch 7 introduces some XFS-specific ENOSPC testing, wherein we try to crash the filesystem by allocating all the blocks in an AG and then expanding the refcount and rmap btrees until the AG runs out of space.
Patch 8 introduces checks that CoW works with a variety of different neighbor blocks -- delalloc, unwritten, hole, and regular.
Patch 9 introduces checks for CoW when blocksize < pagesize.
Patch 10 tries some large CoW operations to ensure that it works correctly.
Patch 11 creates a 'dedupe' group for testing specifically dedupe functionality.
If you're going to start using this mess, you probably ought to just pull from my github trees for kernel[1], xfsprogs[2], xfstests[3], xfs-docs[4], and man-pages[5]. They should just work with the btrfs that's in 4.4... and somewhat buggily with the 4.4 XFS patched with [1]. The relevant xfs_io support will be in xfsprogs 4.3 though it still needs a patch to fix len == 0 support. Probably easier just to grab [2] and build that.
Comments and questions are, as always, welcome.
--D
[1] https://github.com/djwong/linux/tree/for-dave
[2] https://github.com/djwong/xfsprogs/tree/for-dave
[3] https://github.com/djwong/xfstests/tree/for-dave
[4] https://github.com/djwong/xfs-documentation/tree/for-dave
[5] https://github.com/djwong/man-pages/commits/for-mtk
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH v4 1/11 test-scripts: test migration scripts
Add two scripts: "nextid" finds the next available test ID number in a group, and "mvtest" relocates a test, fixes the golden output, and moves the group entry for that test.
v2: sorting group files should preserve group order; nextid should use the same algorithm as new; move both tools to tools/.
--- tools/mvtest | 55 +++++++++++++++++++++++++++ tools/nextid | 1 tools/sort-group | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 168 insertions(+) create mode 100755 tools/mvtest create mode 120000 tools/nextid create mode 100755 tools/sort-group
tools/mvtest new file +55 -0
@@ -0,0 +1,55 @@ +#!/bin/sh + +# Renumber a test +dir="$(dirname "$0")" + +if [ -z "$1" ] || [ "$1" = "--help" ]; then + echo "Usage: $0 path_to_test new_path_to_test" + exit 1 +fi + +src="$1" +dest="$2" + +die() { + echo "$@" + exit 1 +} + +append() { + out="$1" + shift + echo "$@" >> "${out}" +} + +test "${src}" != "${dest}" || die "Test \"${src}\" is the same as dest." +test -e "tests/${src}" || die "Test \"${src}\" does not exist." +test ! -e "tests/${dest}" || die "Test \"${src}\" already exists." + +sid="$(basename "${src}")" +did="$(basename "${dest}")" + +sgroup="$(basename "$(dirname "tests/${src}")")" +dgroup="$(basename "$(dirname "tests/${dest}")")" + +sgroupfile="tests/${sgroup}/group" +dgroupfile="tests/${sgroup}/group" + +git mv "tests/${src}" "tests/${dest}" +git mv "tests/${src}.out" "tests/${dest}.out" +sed -e "s/^# FS QA Test No. ${sid}$/# FS QA Test No. ${did}/g" -i "tests/${dest}" +sed -e "s/^QA output created by ${sid}$/QA output created by ${did}/g" -i "tests/${dest}.out" +sed -e "s/test-${sid}/test-${did}/g" -i "tests/${dest}.out" + +grpline="$(grep "^${sid} " "${sgroupfile}")" +newgrpline="$(echo "${grpline}" | sed -e "s/^${sid} /${did} /g")" + +sed -e "/^${sid}.*$/d" -i "${sgroupfile}" +cp "${dgroupfile}" "${dgroupfile}.new" +append "${dgroupfile}.new" "${newgrpline}" +"${dir}/sort-group.py" "${dgroupfile}.new" +mv "${dgroupfile}.new" "${dgroupfile}" + +echo "Moved \"${src}\" to \"${dest}\"." + +exit 0
tools/nextid new file +1 -0
@@ -0,0 +1 @@ +sort-group
tools/sort-group new file +112 -0
112 lines not on this page · raw message
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH v4 2/11 tests: don't leave cruft behind on the TEST_MNT
In reply to Darrick J. WongDon't leave cruft behind on the test device's filesystem, so as to avoid filling it with debris.
--- tests/generic/110 | 2 +- tests/generic/111 | 2 +- tests/generic/115 | 2 +- tests/generic/159 | 2 +- tests/generic/160 | 2 +- tests/xfs/129 | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-)
tests/generic/110 +1 -1
@@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -f $tmp.* + rm -f $tmp.* "$TESTDIR" } # get standard environment, filters and checks
tests/generic/111 +1 -1
@@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -f $tmp.* + rm -f $tmp.* "$TESTDIR" } # get standard environment, filters and checks
tests/generic/115 +1 -1
@@ -35,7 +35,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -f $tmp.* + rm -f $tmp.* "$TESTDIR" } # get standard environment, filters and checks
tests/generic/159 +1 -1
@@ -32,7 +32,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - # rm -rf "$tmp".* "$TESTDIR1" + rm -rf "$tmp".* "$TESTDIR1" } # get standard environment, filters and checks
tests/generic/160 +1 -1
@@ -32,7 +32,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - # rm -rf "$tmp".* "$TESTDIR1" + rm -rf "$tmp".* "$TESTDIR1" } # get standard environment, filters and checks
tests/xfs/129 +1 -1
@@ -35,7 +35,7 @@ _cleanup() { cd / umount "$SCRATCH_MNT" > /dev/null 2>&1 - rm -rf "$tmp".* "$TESTDIR" "$METADUMP_FILE" + rm -rf "$tmp".* "$TESTDIR" "$METADUMP_FILE" "$TEST_DIR/image" } # get standard environment, filters and checks
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH v4 3/11 generic/15[78]: fix error messages in the golden output
In reply to Darrick J. WongFix the error messages in the golden output for generic/15[78], which examine the responses to invalid inputs as returned by the clone/clone_range/extent_same ioctls. Also fix a filtering omission.
--- tests/generic/157 | 18 +++++++++++++----- tests/generic/157.out | 6 +++--- tests/generic/158 | 18 +++++++++++++----- tests/generic/158.out | 8 ++++---- 4 files changed, 33 insertions(+), 17 deletions(-)
tests/generic/157 +13 -5
@@ -75,10 +75,18 @@ mkdir "$TESTDIR1/dir1" seq 1 $((2 * BLKSZ / 250)) | while read f; do touch "$TESTDIR1/dir1/$f" done -mknod "$TESTDIR1/dev1" b 8 0 +mknod "$TESTDIR1/dev1" c 1 3 mkfifo "$TESTDIR1/fifo1" sync +_filter_enotty() { + sed -e 's/Inappropriate ioctl for device/Invalid argument/g' +} + +_filter_einval() { + sed -e 's/Invalid argument/Bad file descriptor/g' +} + echo "Try cross-device reflink" _reflink_range "$TESTDIR1/file1" 0 "$TESTDIR2/file1" 0 $BLKSZ
@@ -98,16 +106,16 @@ echo "Try to reflink a device" _reflink_range "$TESTDIR1/dev1" 0 "$TESTDIR1/file2" 0 $BLKSZ echo "Try to reflink to a dir" -_reflink_range "$TESTDIR1/file1" 0 "$TESTDIR1/dir1" 0 $BLKSZ +_reflink_range "$TESTDIR1/file1" 0 "$TESTDIR1/dir1" 0 $BLKSZ 2>&1 | _filter_test_dir echo "Try to reflink to a device" -_reflink_range "$TESTDIR1/file1" 0 "$TESTDIR1/dev1" 0 $BLKSZ +_reflink_range "$TESTDIR1/file1" 0 "$TESTDIR1/dev1" 0 $BLKSZ 2>&1 | _filter_enotty echo "Try to reflink to a fifo" -_reflink_range "$TESTDIR1/file1" 0 "$TESTDIR1/fifo1" 0 $BLKSZ -n +_reflink_range "$TESTDIR1/file1" 0 "$TESTDIR1/fifo1" 0 $BLKSZ -n 2>&1 | _filter_enotty echo "Try to reflink an append-only file" -_reflink_range "$TESTDIR1/file1" 0 "$TESTDIR1/file3" 0 $BLKSZ -a +_reflink_range "$TESTDIR1/file1" 0 "$TESTDIR1/file3" 0 $BLKSZ -a 2>&1 | _filter_einval echo "Reflink two files" _reflink_range "$TESTDIR1/file1" 0 "$TESTDIR1/file2" 0 $BLKSZ >> "$seqres.full"
tests/generic/157.out +3 -3
@@ -14,11 +14,11 @@ XFS_IOC_CLONE_RANGE: Is a directory Try to reflink a device XFS_IOC_CLONE_RANGE: Invalid argument Try to reflink to a dir -/mnt/test-157/dir1: Is a directory +TEST_DIR/test-157/dir1: Is a directory Try to reflink to a device -XFS_IOC_CLONE_RANGE: Operation not supported +XFS_IOC_CLONE_RANGE: Invalid argument Try to reflink to a fifo -XFS_IOC_CLONE_RANGE: Operation not supported +XFS_IOC_CLONE_RANGE: Invalid argument Try to reflink an append-only file XFS_IOC_CLONE_RANGE: Bad file descriptor Reflink two files
tests/generic/158 +13 -5
@@ -76,10 +76,18 @@ mkdir "$TESTDIR1/dir1" seq 1 $((2 * BLKSZ / 250)) | while read f; do touch "$TESTDIR1/dir1/$f" done -mknod "$TESTDIR1/dev1" b 8 0 +mknod "$TESTDIR1/dev1" c 1 3 mkfifo "$TESTDIR1/fifo1" sync +_filter_enotty() { + sed -e 's/Inappropriate ioctl for device/Invalid argument/g' +} + +_filter_eperm() { + sed -e 's/Permission denied/Invalid argument/g' +} + echo "Try cross-device dedupe" _dedupe_range "$TESTDIR1/file1" 0 "$TESTDIR2/file1" 0 $BLKSZ
@@ -96,16 +104,16 @@ echo "Try to dedupe a dir" _dedupe_range "$TESTDIR1/dir1" 0 "$TESTDIR1/file2" 0 $BLKSZ echo "Try to dedupe a device" -_dedupe_range "$TESTDIR1/dev1" 0 "$TESTDIR1/file2" 0 $BLKSZ +_dedupe_range "$TESTDIR1/dev1" 0 "$TESTDIR1/file2" 0 $BLKSZ 2>&1 | _filter_enotty echo "Try to dedupe to a dir" -_dedupe_range "$TESTDIR1/file1" 0 "$TESTDIR1/dir1" 0 $BLKSZ +_dedupe_range "$TESTDIR1/file1" 0 "$TESTDIR1/dir1" 0 $BLKSZ 2>&1 | _filter_test_dir echo "Try to dedupe to a device" -_dedupe_range "$TESTDIR1/file1" 0 "$TESTDIR1/dev1" 0 $BLKSZ +_dedupe_range "$TESTDIR1/file1" 0 "$TESTDIR1/dev1" 0 $BLKSZ 2>&1 | _filter_eperm echo "Try to dedupe to a fifo" -_dedupe_range "$TESTDIR1/file1" 0 "$TESTDIR1/fifo1" 0 $BLKSZ -n +_dedupe_range "$TESTDIR1/file1" 0 "$TESTDIR1/fifo1" 0 $BLKSZ -n 2>&1 | _filter_eperm echo "Try to dedupe an append-only file" _dedupe_range "$TESTDIR1/file1" 0 "$TESTDIR1/file3" 0 $BLKSZ -a >> "$seqres.full"
tests/generic/158.out +4 -4
@@ -12,13 +12,13 @@ dedupe: Invalid argument Try to dedupe a dir XFS_IOC_FILE_EXTENT_SAME: Is a directory Try to dedupe a device -XFS_IOC_FILE_EXTENT_SAME: Permission denied +XFS_IOC_FILE_EXTENT_SAME: Invalid argument Try to dedupe to a dir -/mnt/test-158/dir1: Is a directory +TEST_DIR/test-158/dir1: Is a directory Try to dedupe to a device -dedupe: Permission denied +dedupe: Invalid argument Try to dedupe to a fifo -dedupe: Permission denied +dedupe: Invalid argument Try to dedupe an append-only file Dedupe two files Check scratch fs
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH v4 4/11 xfs/128: allow larger margin for disk space usage
In reply to Darrick J. WongThe free blocks count can vary from our calculations by up to 8% on a 1k-block filesystem, so permit that.
--- tests/xfs/128 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/xfs/128 +1 -1
@@ -59,7 +59,7 @@ FREE_BLOCKS0=$(stat -f "$TESTDIR" -c '%f') echo "Create the original file and reflink to file2, file3" BLKS=2000 -MARGIN=100 +MARGIN=160 BLKSZ=65536 REAL_BLKSZ="$(stat -f $TESTDIR -c '%S')" BLKSZ_FACTOR=$((BLKSZ / REAL_BLKSZ))
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH v4 5/11 xfs/129: require loop
In reply to Darrick J. WongMissed a _require_loop for xfs/129.
--- tests/xfs/129 | 1 + 1 file changed, 1 insertion(+)
tests/xfs/129 +1 -0
@@ -46,6 +46,7 @@ _cleanup() # real QA test starts here _supported_os Linux _supported_fs xfs +_require_loop _require_scratch_reflink rm -f "$seqres.full"
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH v4 6/11 reflink: more tests
In reply to Darrick J. WongAdd more tests for unaligned copy-on-write things, and explicitly test the ability to pass "len == 0" to mean reflink/dedupe all the way to the end of the file".
--- tests/generic/820 | 77 ++++++++++++++++++++++++++++++++ tests/generic/820.out | 8 +++ tests/generic/847 | 96 ++++++++++++++++++++++++++++++++++++++++ tests/generic/847.out | 11 +++++ tests/generic/848 | 96 ++++++++++++++++++++++++++++++++++++++++ tests/generic/848.out | 11 +++++ tests/generic/849 | 80 ++++++++++++++++++++++++++++++++++ tests/generic/849.out | 6 +++ tests/generic/850 | 117 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/850.out | 17 +++++++ tests/generic/group | 5 ++ 11 files changed, 524 insertions(+) create mode 100755 tests/generic/820 create mode 100644 tests/generic/820.out create mode 100755 tests/generic/847 create mode 100644 tests/generic/847.out create mode 100755 tests/generic/848 create mode 100644 tests/generic/848.out create mode 100755 tests/generic/849 create mode 100644 tests/generic/849.out create mode 100755 tests/generic/850 create mode 100644 tests/generic/850.out
tests/generic/820 new file +77 -0
@@ -0,0 +1,77 @@ +#! /bin/bash +# FS QA Test No. 820 +# +# Ensure that punch-hole doesn't clobber CoW. +# +#----------------------------------------------------------------------- +# Copyright (c) 2015, Oracle and/or its affiliates. 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".* "$TESTDIR" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_test_reflink +_require_cp_reflink +_require_xfs_io_command "fpunch" + +rm -f "$seqres.full" + +TESTDIR="$TEST_DIR/test-$seq" +rm -rf "$TESTDIR" +mkdir "$TESTDIR" + +echo "Create the original files" +BLKSZ=65536 +NR=512 +_pwrite_byte 0x61 0 $((BLKSZ * NR)) "$TESTDIR/file1" >> "$seqres.full" + +_cp_reflink "$TESTDIR/file1" "$TESTDIR/file2" +_test_remount + +md5sum "$TESTDIR/file1" | _filter_test_dir +md5sum "$TESTDIR/file2" | _filter_test_dir + +echo "Write and punch" +_pwrite_byte 0x62 0 $((BLKSZ * 256)) "$TESTDIR/file2" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "fpunch $BLKSZ $((BLKSZ * 254))" "$TESTDIR/file2" +_test_remount + +echo "Compare results" +md5sum "$TESTDIR/file1" | _filter_test_dir +md5sum "$TESTDIR/file2" | _filter_test_dir + +# success, all done +status=0 +exit
tests/generic/820.out new file +8 -0
@@ -0,0 +1,8 @@ +QA output created by 820 +Create the original files +bc3d7c2ff64219e33239f2e13c2d21db TEST_DIR/test-820/file1 +bc3d7c2ff64219e33239f2e13c2d21db TEST_DIR/test-820/file2 +Write and punch +Compare results +bc3d7c2ff64219e33239f2e13c2d21db TEST_DIR/test-820/file1 +95cfd19ce56010430dc2057413d7efc5 TEST_DIR/test-820/file2
tests/generic/847 new file +96 -0
96 lines not on this page · raw message
tests/generic/847.out new file +11 -0
@@ -0,0 +1,11 @@ +QA output created by 847 +Create the original files +998b4ba52f2940dc515001e75926b19f TEST_DIR/test-847/file1 +998b4ba52f2940dc515001e75926b19f TEST_DIR/test-847/file2 +8cdf70c9cfb33bdc7397806b87e7c7ea TEST_DIR/test-847/file2.chk +fpunch files +Compare files +998b4ba52f2940dc515001e75926b19f TEST_DIR/test-847/file1 +8cdf70c9cfb33bdc7397806b87e7c7ea TEST_DIR/test-847/file2 +8cdf70c9cfb33bdc7397806b87e7c7ea TEST_DIR/test-847/file2.chk +Compare against check files
tests/generic/848 new file +96 -0
96 lines not on this page · raw message
tests/generic/848.out new file +11 -0
@@ -0,0 +1,11 @@ +QA output created by 848 +Create the original files +998b4ba52f2940dc515001e75926b19f TEST_DIR/test-848/file1 +998b4ba52f2940dc515001e75926b19f TEST_DIR/test-848/file2 +8cdf70c9cfb33bdc7397806b87e7c7ea TEST_DIR/test-848/file2.chk +fzero files +Compare files +998b4ba52f2940dc515001e75926b19f TEST_DIR/test-848/file1 +8cdf70c9cfb33bdc7397806b87e7c7ea TEST_DIR/test-848/file2 +8cdf70c9cfb33bdc7397806b87e7c7ea TEST_DIR/test-848/file2.chk +Compare against check files
tests/generic/849 new file +80 -0
80 lines not on this page · raw message
tests/generic/849.out new file +6 -0
@@ -0,0 +1,6 @@ +QA output created by 849 +Create the original files +f4820540fc0ac02750739896fe028d56 TEST_DIR/test-849/file1 +dc881c004745c49f7f4e9cc766f57bc8 TEST_DIR/test-849/file2 +dc881c004745c49f7f4e9cc766f57bc8 TEST_DIR/test-849/file2.chk +Compare against check files
tests/generic/850 new file +117 -0
117 lines not on this page · raw message
tests/generic/850.out new file +17 -0
@@ -0,0 +1,17 @@ +QA output created by 850 +Create the original files +f4820540fc0ac02750739896fe028d56 TEST_DIR/test-850/file1 +69ad53078a16243d98e21d9f8704a071 TEST_DIR/test-850/file2 +69ad53078a16243d98e21d9f8704a071 TEST_DIR/test-850/file2.chk +Compare against check files +Make the original file almost dedup-able +f4820540fc0ac02750739896fe028d56 TEST_DIR/test-850/file1 +158d4e3578b94b89cbb44493a2110fb9 TEST_DIR/test-850/file2 +158d4e3578b94b89cbb44493a2110fb9 TEST_DIR/test-850/file2.chk +Compare against check files +Make the original file dedup-able +f4820540fc0ac02750739896fe028d56 TEST_DIR/test-850/file1 +113c7055ffe3d24d2dec27e82ab55abd TEST_DIR/test-850/file2 +113c7055ffe3d24d2dec27e82ab55abd TEST_DIR/test-850/file2.chk +file1 and file2 should match +Compare against check files
tests/generic/group +5 -0
@@ -257,3 +257,8 @@ 323 auto aio stress 324 auto fsr quick 325 auto quick data log +820 auto quick clone +847 auto quick clone +848 auto quick clone +849 auto quick clone +850 auto quick clone
Re: [PATCH 06/11] reflink: more tests
Quoted 5 lines · Darrick J. Wong
Add more tests for unaligned copy-on-write things, and explicitly test the ability to pass "len == 0" to mean reflink/dedupe all the way to the end of the file".
Signed-off-by Darrick J. Wong <[email protected]>
.....
Quoted 5 lines
tests/generic/820 new file +5
-0+_cleanup() +{ + cd / + rm -rf "$tmp".* "$TESTDIR" +}
.....
tests/generic/820 line 53
Quoted 4 lines
tests/generic/820 new file +4
-0+ +TESTDIR="$TEST_DIR/test-$seq" +rm -rf "$TESTDIR" +mkdir "$TESTDIR"
This use of TESTDIR is highly confusing. When I see TESTDIR I think that it's the mount point of the test device, not potentially some directory on the scratch device.
I see that this occurs through lots of tests, not just these new ones. Can you do a pass across the tests with, say, sed and rename all these to something less confusing? e.g. "testdir", in lower case, makes it clear that it's a local variable, not the global test device mount point.... (i.e. test local variables are lower case, exported test harnes variables are upper case ;)
Separate patch/pull req is fine.
Cheers,
dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 06/11] reflink: more tests
Quoted 22 lines · Dave Chinner
Quoted 5 lines · Darrick J. Wong
Add more tests for unaligned copy-on-write things, and explicitly test the ability to pass "len == 0" to mean reflink/dedupe all the way to the end of the file".
Signed-off-by Darrick J. Wong <[email protected]>.....
Quoted 5 lines
tests/generic/820 new file +5
-0+_cleanup() +{ + cd / + rm -rf "$tmp".* "$TESTDIR" +}.....
tests/generic/820 line 53
Quoted 4 lines
tests/generic/820 new file +4
-0+ +TESTDIR="$TEST_DIR/test-$seq" +rm -rf "$TESTDIR" +mkdir "$TESTDIR"This use of TESTDIR is highly confusing. When I see TESTDIR I think that it's the mount point of the test device, not potentially some directory on the scratch device.
Quoted 8 lines
I see that this occurs through lots of tests, not just these new ones. Can you do a pass across the tests with, say, sed and rename all these to something less confusing? e.g. "testdir", in lower case, makes it clear that it's a local variable, not the global test device mount point.... (i.e. test local variables are lower case, exported test harnes variables are upper case ;)
Separate patch/pull req is fine.
No problem. Will give it a spin on the test harness before sending.
(Yikes, it's a 272K patch...)
--D
Quoted 7 lines
Cheers,
dave.
Signature · 2 lines
Dave Chinner [email protected]
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH v4 7/11 reflink: test ENOSPC when expanding btrees during reflink operations
In reply to Darrick J. WongSee what happens when we ENOSPC while growing a btree on behalf of some reflink operation.
--- tests/xfs/805 | 82 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/805.out | 8 +++++ tests/xfs/806 | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/806.out | 7 ++++ tests/xfs/group | 2 + 5 files changed, 188 insertions(+) create mode 100755 tests/xfs/805 create mode 100644 tests/xfs/805.out create mode 100755 tests/xfs/806 create mode 100644 tests/xfs/806.out
tests/xfs/805 new file +82 -0
@@ -0,0 +1,82 @@ +#! /bin/bash +# FS QA Test No. 806 +# +# Try to ENOSPC while expanding the refcntbt by CoWing every block +# of a file that eats the whole AG. +# +#----------------------------------------------------------------------- +# Copyright (c) 2015, Oracle and/or its affiliates. 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".* "$TESTDIR" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs -d agsize=$((32 * 1048576)) > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +TESTDIR="$SCRATCH_MNT/test-$seq" +rm -rf "$TESTDIR" +mkdir "$TESTDIR" +BLKSZ="$(stat -f "$TESTDIR" -c '%S')" + +echo "Create the original files" +SZ=$((48 * 1048576)) +NR=$((SZ / BLKSZ)) +_pwrite_byte 0x61 0 $SZ "$TESTDIR/file1" >> "$seqres.full" +_cp_reflink "$TESTDIR/file1" "$TESTDIR/file2" >> "$seqres.full" +_scratch_remount + +echo "CoW every other block" +_pwrite_byte 0x62 0 $SZ "$TESTDIR/file1" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$TESTDIR/file1" | _filter_test_dir +md5sum "$TESTDIR/file2" | _filter_test_dir +#filefrag -v "$TESTDIR/file1" "$TESTDIR/file2" + +echo "Check scratch fs" +umount "$SCRATCH_MNT" +_check_scratch_fs + +# success, all done +status=0 +exit
tests/xfs/805.out new file +8 -0
@@ -0,0 +1,8 @@ +QA output created by 805 +Format and mount +Create the original files +CoW every other block +Compare files +673c759fb131ccf3336c4f8c549a497e /opt/test-805/file1 +dc802351f6717547cbf4c951b294f952 /opt/test-805/file2 +Check scratch fs
tests/xfs/806 new file +89 -0
89 lines not on this page · raw message
tests/xfs/806.out new file +7 -0
@@ -0,0 +1,7 @@ +QA output created by 806 +Format and mount +Create the original files +Compare files +CoW every other block +Compare files +Check scratch fs
tests/xfs/group +2 -0
@@ -226,3 +226,5 @@ 303 auto quick quota 304 auto quick quota 305 auto quota +805 auto quick clone +806 auto quick clone
PATCH v4 8/11 reflink: more CoW tests for reflink and dedupe
In reply to Darrick J. WongThese tests examine the behavior of advanced and tricky copy on write situations.
--- tests/generic/851 | 101 ++++++++++++++++++++++++++++++++++ tests/generic/851.out | 15 +++++ tests/generic/852 | 101 ++++++++++++++++++++++++++++++++++ tests/generic/852.out | 15 +++++ tests/generic/853 | 146 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/853.out | 15 +++++ tests/generic/854 | 146 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/854.out | 15 +++++ tests/generic/855 | 96 ++++++++++++++++++++++++++++++++ tests/generic/855.out | 13 ++++ tests/generic/856 | 96 ++++++++++++++++++++++++++++++++ tests/generic/856.out | 13 ++++ tests/generic/857 | 96 ++++++++++++++++++++++++++++++++ tests/generic/857.out | 13 ++++ tests/generic/858 | 96 ++++++++++++++++++++++++++++++++ tests/generic/858.out | 13 ++++ tests/generic/859 | 101 ++++++++++++++++++++++++++++++++++ tests/generic/859.out | 13 ++++ tests/generic/860 | 101 ++++++++++++++++++++++++++++++++++ tests/generic/860.out | 13 ++++ tests/generic/861 | 96 ++++++++++++++++++++++++++++++++ tests/generic/861.out | 13 ++++ tests/generic/862 | 96 ++++++++++++++++++++++++++++++++ tests/generic/862.out | 13 ++++ tests/generic/863 | 125 ++++++++++++++++++++++++++++++++++++++++++ tests/generic/863.out | 13 ++++ tests/generic/864 | 125 ++++++++++++++++++++++++++++++++++++++++++ tests/generic/864.out | 13 ++++ tests/generic/865 | 86 +++++++++++++++++++++++++++++ tests/generic/865.out | 9 +++ tests/generic/866 | 86 +++++++++++++++++++++++++++++ tests/generic/866.out | 13 ++++ tests/generic/867 | 86 +++++++++++++++++++++++++++++ tests/generic/867.out | 13 ++++ tests/generic/group | 17 ++++++ 35 files changed, 2022 insertions(+) create mode 100755 tests/generic/851 create mode 100644 tests/generic/851.out create mode 100755 tests/generic/852 create mode 100644 tests/generic/852.out create mode 100755 tests/generic/853 create mode 100644 tests/generic/853.out create mode 100755 tests/generic/854 create mode 100644 tests/generic/854.out create mode 100755 tests/generic/855 create mode 100644 tests/generic/855.out create mode 100755 tests/generic/856 create mode 100644 tests/generic/856.out create mode 100755 tests/generic/857 create mode 100644 tests/generic/857.out create mode 100755 tests/generic/858 create mode 100644 tests/generic/858.out create mode 100755 tests/generic/859 create mode 100644 tests/generic/859.out create mode 100755 tests/generic/860 create mode 100644 tests/generic/860.out create mode 100755 tests/generic/861 create mode 100644 tests/generic/861.out create mode 100755 tests/generic/862 create mode 100644 tests/generic/862.out create mode 100755 tests/generic/863 create mode 100644 tests/generic/863.out create mode 100755 tests/generic/864 create mode 100644 tests/generic/864.out create mode 100755 tests/generic/865 create mode 100644 tests/generic/865.out create mode 100755 tests/generic/866 create mode 100644 tests/generic/866.out create mode 100755 tests/generic/867 create mode 100644 tests/generic/867.out
tests/generic/851 new file +101 -0
@@ -0,0 +1,101 @@ +#! /bin/bash +# FS QA Test No. 851 +# +# Ensuring that copy on write in direct-io mode works when the CoW +# range originally covers multiple extents. +# - Create two files +# - Reflink the odd blocks of the first file into a third file. +# - Reflink the even blocks of the second file into the third file. +# - directio CoW across the halfway mark. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2015, Oracle and/or its affiliates. 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".* "$TESTDIR" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +TESTDIR="$SCRATCH_MNT/test-$seq" +rm -rf $TESTDIR +mkdir $TESTDIR + +echo "Create the original files" +BLKSZ=65536 +NR=64 +_pwrite_byte 0x61 0 $((BLKSZ * NR)) "$TESTDIR/file1" >> "$seqres.full" +_pwrite_byte 0x62 0 $((BLKSZ * NR)) "$TESTDIR/file2" >> "$seqres.full" +seq 0 2 $((NR-1)) | while read f; do + _reflink_range "$TESTDIR/file1" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full" + _pwrite_byte 0x61 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full" +done +seq 1 2 $NR | while read f; do + _reflink_range "$TESTDIR/file2" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full" + _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full" +done +_scratch_remount + +echo "Compare files" +md5sum "$TESTDIR/file1" | _filter_scratch +md5sum "$TESTDIR/file2" | _filter_scratch +md5sum "$TESTDIR/file3" | _filter_scratch +md5sum "$TESTDIR/file3.chk" | _filter_scratch + +echo "directio CoW across the transition" +"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((BLKSZ * NR / 2)) $((BLKSZ * NR / 4)) $((BLKSZ * NR / 2))" "$TESTDIR/file3" >> "$seqres.full" +_pwrite_byte 0x63 $((BLKSZ * NR / 4)) $((BLKSZ * NR / 2)) "$TESTDIR/file3.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$TESTDIR/file1" | _filter_scratch +md5sum "$TESTDIR/file2" | _filter_scratch +md5sum "$TESTDIR/file3" | _filter_scratch +md5sum "$TESTDIR/file3.chk" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" +_check_scratch_fs + +# success, all done +status=0 +exit
tests/generic/851.out new file +15 -0
@@ -0,0 +1,15 @@ +QA output created by 851 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-851/file1 +b83f9394092e15bdcda585cd8e776dc6 SCRATCH_MNT/test-851/file2 +d3959a68638c50af07f0258e032cb554 SCRATCH_MNT/test-851/file3 +d3959a68638c50af07f0258e032cb554 SCRATCH_MNT/test-851/file3.chk +directio CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-851/file1 +b83f9394092e15bdcda585cd8e776dc6 SCRATCH_MNT/test-851/file2 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-851/file3 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-851/file3.chk +Check for damage
tests/generic/852 new file +101 -0
101 lines not on this page · raw message
tests/generic/852.out new file +15 -0
@@ -0,0 +1,15 @@ +QA output created by 852 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-852/file1 +b83f9394092e15bdcda585cd8e776dc6 SCRATCH_MNT/test-852/file2 +d3959a68638c50af07f0258e032cb554 SCRATCH_MNT/test-852/file3 +d3959a68638c50af07f0258e032cb554 SCRATCH_MNT/test-852/file3.chk +CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-852/file1 +b83f9394092e15bdcda585cd8e776dc6 SCRATCH_MNT/test-852/file2 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-852/file3 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-852/file3.chk +Check for damage
tests/generic/853 new file +146 -0
146 lines not on this page · raw message
tests/generic/853.out new file +15 -0
@@ -0,0 +1,15 @@ +QA output created by 853 +Format and mount +Create the original files +Compare files +6488f52f2d2351fa5ca1f6410df8684d SCRATCH_MNT/test-853/file1 +35219c511215d00a857243965ea5ed9c SCRATCH_MNT/test-853/file2 +8d9ea4925db533da10a45d2919d8d2d9 SCRATCH_MNT/test-853/file3 +8d9ea4925db533da10a45d2919d8d2d9 SCRATCH_MNT/test-853/file3.chk +CoW with multiple extents? +Compare files +6488f52f2d2351fa5ca1f6410df8684d SCRATCH_MNT/test-853/file1 +35219c511215d00a857243965ea5ed9c SCRATCH_MNT/test-853/file2 +1801718b8daeb8d3ad4900bd9137b3e8 SCRATCH_MNT/test-853/file3 +1801718b8daeb8d3ad4900bd9137b3e8 SCRATCH_MNT/test-853/file3.chk +Check for damage
tests/generic/854 new file +146 -0
146 lines not on this page · raw message
tests/generic/854.out new file +15 -0
@@ -0,0 +1,15 @@ +QA output created by 854 +Format and mount +Create the original files +Compare files +6488f52f2d2351fa5ca1f6410df8684d SCRATCH_MNT/test-854/file1 +35219c511215d00a857243965ea5ed9c SCRATCH_MNT/test-854/file2 +8d9ea4925db533da10a45d2919d8d2d9 SCRATCH_MNT/test-854/file3 +8d9ea4925db533da10a45d2919d8d2d9 SCRATCH_MNT/test-854/file3.chk +CoW with multiple extents? +Compare files +6488f52f2d2351fa5ca1f6410df8684d SCRATCH_MNT/test-854/file1 +35219c511215d00a857243965ea5ed9c SCRATCH_MNT/test-854/file2 +1801718b8daeb8d3ad4900bd9137b3e8 SCRATCH_MNT/test-854/file3 +1801718b8daeb8d3ad4900bd9137b3e8 SCRATCH_MNT/test-854/file3.chk +Check for damage
tests/generic/855 new file +96 -0
96 lines not on this page · raw message
tests/generic/855.out new file +13 -0
@@ -0,0 +1,13 @@ +QA output created by 855 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-855/file1 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-855/file3 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-855/file3.chk +directio CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-855/file1 +09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-855/file3 +09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-855/file3.chk +Check for damage
tests/generic/856 new file +96 -0
96 lines not on this page · raw message
tests/generic/856.out new file +13 -0
@@ -0,0 +1,13 @@ +QA output created by 856 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-856/file1 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-856/file3 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-856/file3.chk +CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-856/file1 +09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-856/file3 +09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-856/file3.chk +Check for damage
tests/generic/857 new file +96 -0
96 lines not on this page · raw message
tests/generic/857.out new file +13 -0
@@ -0,0 +1,13 @@ +QA output created by 857 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-857/file1 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-857/file3 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-857/file3.chk +directio CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-857/file1 +09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-857/file3 +09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-857/file3.chk +Check for damage
tests/generic/858 new file +96 -0
96 lines not on this page · raw message
tests/generic/858.out new file +13 -0
@@ -0,0 +1,13 @@ +QA output created by 858 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-858/file1 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-858/file3 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-858/file3.chk +CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-858/file1 +09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-858/file3 +09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-858/file3.chk +Check for damage
tests/generic/859 new file +101 -0
101 lines not on this page · raw message
tests/generic/859.out new file +13 -0
@@ -0,0 +1,13 @@ +QA output created by 859 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-859/file1 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-859/file3 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-859/file3.chk +directio CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-859/file1 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-859/file3 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-859/file3.chk +Check for damage
tests/generic/860 new file +101 -0
101 lines not on this page · raw message
tests/generic/860.out new file +13 -0
@@ -0,0 +1,13 @@ +QA output created by 860 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-860/file1 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-860/file3 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-860/file3.chk +CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-860/file1 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-860/file3 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-860/file3.chk +Check for damage
tests/generic/861 new file +96 -0
96 lines not on this page · raw message
tests/generic/861.out new file +13 -0
@@ -0,0 +1,13 @@ +QA output created by 861 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-861/file1 +d3959a68638c50af07f0258e032cb554 SCRATCH_MNT/test-861/file3 +d3959a68638c50af07f0258e032cb554 SCRATCH_MNT/test-861/file3.chk +directio CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-861/file1 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-861/file3 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-861/file3.chk +Check for damage
tests/generic/862 new file +96 -0
96 lines not on this page · raw message
tests/generic/862.out new file +13 -0
@@ -0,0 +1,13 @@ +QA output created by 862 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-862/file1 +d3959a68638c50af07f0258e032cb554 SCRATCH_MNT/test-862/file3 +d3959a68638c50af07f0258e032cb554 SCRATCH_MNT/test-862/file3.chk +CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-862/file1 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-862/file3 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-862/file3.chk +Check for damage
tests/generic/863 new file +125 -0
125 lines not on this page · raw message
tests/generic/863.out new file +13 -0
@@ -0,0 +1,13 @@ +QA output created by 863 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-863/file1 +6366fd359371414186688a0ef6988893 SCRATCH_MNT/test-863/file3 +6366fd359371414186688a0ef6988893 SCRATCH_MNT/test-863/file3.chk +directio CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-863/file1 +36f6b5317a9a921fc91175390ccf7f69 SCRATCH_MNT/test-863/file3 +36f6b5317a9a921fc91175390ccf7f69 SCRATCH_MNT/test-863/file3.chk +Check for damage
tests/generic/864 new file +125 -0
125 lines not on this page · raw message
tests/generic/864.out new file +13 -0
@@ -0,0 +1,13 @@ +QA output created by 864 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-864/file1 +6366fd359371414186688a0ef6988893 SCRATCH_MNT/test-864/file3 +6366fd359371414186688a0ef6988893 SCRATCH_MNT/test-864/file3.chk +directio CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-864/file1 +36f6b5317a9a921fc91175390ccf7f69 SCRATCH_MNT/test-864/file3 +36f6b5317a9a921fc91175390ccf7f69 SCRATCH_MNT/test-864/file3.chk +Check for damage
tests/generic/865 new file +86 -0
86 lines not on this page · raw message
tests/generic/865.out new file +9 -0
@@ -0,0 +1,9 @@ +QA output created by 865 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-865/file1 +d3959a68638c50af07f0258e032cb554 SCRATCH_MNT/test-865/file3 +d3959a68638c50af07f0258e032cb554 SCRATCH_MNT/test-865/file3.chk +CoW and unmount +Check for damage
tests/generic/866 new file +86 -0
86 lines not on this page · raw message
tests/generic/866.out new file +13 -0
@@ -0,0 +1,13 @@ +QA output created by 866 +Format and mount +Create the original files +Compare files +75f550706b7d54e6ae59a8220b532285 SCRATCH_MNT/test-866/file1 +75f550706b7d54e6ae59a8220b532285 SCRATCH_MNT/test-866/file2 +75f550706b7d54e6ae59a8220b532285 SCRATCH_MNT/test-866/file2.chk +CoW and unmount +Compare files +75f550706b7d54e6ae59a8220b532285 SCRATCH_MNT/test-866/file1 +7cd112044b63b2c979f45e7c1e7cc85f SCRATCH_MNT/test-866/file2 +7cd112044b63b2c979f45e7c1e7cc85f SCRATCH_MNT/test-866/file2.chk +Check for damage
tests/generic/867 new file +86 -0
86 lines not on this page · raw message
tests/generic/867.out new file +13 -0
@@ -0,0 +1,13 @@ +QA output created by 867 +Format and mount +Create the original files +Compare files +75f550706b7d54e6ae59a8220b532285 SCRATCH_MNT/test-867/file1 +75f550706b7d54e6ae59a8220b532285 SCRATCH_MNT/test-867/file2 +75f550706b7d54e6ae59a8220b532285 SCRATCH_MNT/test-867/file2.chk +CoW and unmount +Compare files +75f550706b7d54e6ae59a8220b532285 SCRATCH_MNT/test-867/file1 +227f44bb2dcf251ebf0217edaeb1e365 SCRATCH_MNT/test-867/file2 +227f44bb2dcf251ebf0217edaeb1e365 SCRATCH_MNT/test-867/file2.chk +Check for damage
tests/generic/group +17 -0
@@ -262,3 +262,20 @@ 848 auto quick clone 849 auto quick clone 850 auto quick clone +851 auto quick clone +852 auto quick clone +853 auto quick clone +854 auto quick clone +855 auto quick clone +856 auto quick clone +857 auto quick clone +858 auto quick clone +859 auto quick clone +860 auto quick clone +861 auto quick clone +862 auto quick clone +863 auto quick clone +864 auto quick clone +865 auto quick clone +866 auto quick clone +867 auto quick clone
PATCH v4 9/11 reflink: test CoW with blocksize < pagesize
In reply to Darrick J. WongTest CoW operations when blocksize < pagesize and the only reflink block is in the middle of the page.
--- common/reflink | 30 +++++++++ tests/generic/868 | 102 +++++++++++++++++++++++++++++++ tests/generic/868.out | 7 ++ tests/generic/869 | 102 +++++++++++++++++++++++++++++++ tests/generic/869.out | 7 ++ tests/generic/870 | 103 +++++++++++++++++++++++++++++++ tests/generic/870.out | 7 ++ tests/generic/871 | 103 +++++++++++++++++++++++++++++++ tests/generic/871.out | 7 ++ tests/generic/872 | 97 +++++++++++++++++++++++++++++ tests/generic/872.out | 7 ++ tests/generic/873 | 97 +++++++++++++++++++++++++++++ tests/generic/873.out | 7 ++ tests/generic/874 | 103 +++++++++++++++++++++++++++++++ tests/generic/874.out | 7 ++ tests/generic/875 | 103 +++++++++++++++++++++++++++++++ tests/generic/875.out | 7 ++ tests/generic/876 | 163 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/876.out | 83 +++++++++++++++++++++++++ tests/generic/877 | 163 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/877.out | 83 +++++++++++++++++++++++++ tests/generic/group | 10 +++ 22 files changed, 1398 insertions(+) create mode 100755 tests/generic/868 create mode 100644 tests/generic/868.out create mode 100755 tests/generic/869 create mode 100644 tests/generic/869.out create mode 100755 tests/generic/870 create mode 100644 tests/generic/870.out create mode 100755 tests/generic/871 create mode 100644 tests/generic/871.out create mode 100755 tests/generic/872 create mode 100644 tests/generic/872.out create mode 100755 tests/generic/873 create mode 100644 tests/generic/873.out create mode 100755 tests/generic/874 create mode 100644 tests/generic/874.out create mode 100755 tests/generic/875 create mode 100644 tests/generic/875.out create mode 100755 tests/generic/876 create mode 100644 tests/generic/876.out create mode 100755 tests/generic/877 create mode 100644 tests/generic/877.out
common/reflink +30 -0
@@ -183,3 +183,33 @@ _dedupe_range() { "$XFS_IO_PROG" $xfs_io_args -f -c "dedupe $file1 $offset1 $offset2 $len" "$file2" } + +# Create fs of certain blocksize on scratch device +# _scratch_mkfs_blocksized blocksize +_scratch_mkfs_blocksized() +{ + blocksize=$1 + + re='^[0-9]+$' + if ! [[ $blocksize =~ $re ]] ; then + _notrun "error: _scratch_mkfs_sized: block size \"$blocksize\" not an integer." + fi + + case $FSTYP in + xfs) + # don't override MKFS_OPTIONS that set a block size. + echo $MKFS_OPTIONS |egrep -q "b?size=" + if [ $? -eq 0 ]; then + _scratch_mkfs_xfs + else + _scratch_mkfs_xfs -b size=$blocksize + fi + ;; + ext2|ext3|ext4|ocfs2) + ${MKFS_PROG}.$FSTYP -F $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV + ;; + *) + _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_blocksized" + ;; + esac +}
tests/generic/868 new file +102 -0
102 lines not on this page · raw message
tests/generic/868.out new file +7 -0
@@ -0,0 +1,7 @@ +QA output created by 868 +Format and mount +Create the original files +Compare files +CoW and unmount +Compare files +Check for damage
tests/generic/869 new file +102 -0
102 lines not on this page · raw message
tests/generic/869.out new file +7 -0
@@ -0,0 +1,7 @@ +QA output created by 869 +Format and mount +Create the original files +Compare files +CoW and unmount +Compare files +Check for damage
tests/generic/870 new file +103 -0
103 lines not on this page · raw message
tests/generic/870.out new file +7 -0
@@ -0,0 +1,7 @@ +QA output created by 870 +Format and mount +Create the original files +Compare files +CoW and unmount +Compare files +Check for damage
tests/generic/871 new file +103 -0
103 lines not on this page · raw message
tests/generic/871.out new file +7 -0
@@ -0,0 +1,7 @@ +QA output created by 871 +Format and mount +Create the original files +Compare files +CoW and unmount +Compare files +Check for damage
tests/generic/872 new file +97 -0
97 lines not on this page · raw message
tests/generic/872.out new file +7 -0
@@ -0,0 +1,7 @@ +QA output created by 872 +Format and mount +Create the original files +Compare files +CoW and unmount +Compare files +Check for damage
tests/generic/873 new file +97 -0
97 lines not on this page · raw message
tests/generic/873.out new file +7 -0
@@ -0,0 +1,7 @@ +QA output created by 873 +Format and mount +Create the original files +Compare files +CoW and unmount +Compare files +Check for damage
tests/generic/874 new file +103 -0
103 lines not on this page · raw message
tests/generic/874.out new file +7 -0
@@ -0,0 +1,7 @@ +QA output created by 874 +Format and mount +Create the original files +Compare files +CoW and unmount +Compare files +Check for damage
tests/generic/875 new file +103 -0
103 lines not on this page · raw message
tests/generic/875.out new file +7 -0
@@ -0,0 +1,7 @@ +QA output created by 875 +Format and mount +Create the original files +Compare files +CoW and unmount +Compare files +Check for damage
tests/generic/876 new file +163 -0
163 lines not on this page · raw message
tests/generic/876.out new file +83 -0
83 lines not on this page · raw message
tests/generic/877 new file +163 -0
163 lines not on this page · raw message
tests/generic/877.out new file +83 -0
83 lines not on this page · raw message
tests/generic/group +10 -0
@@ -279,3 +279,13 @@ 865 auto quick clone 866 auto quick clone 867 auto quick clone +868 auto quick clone +869 auto quick clone +870 auto quick clone +871 auto quick clone +872 auto quick clone +873 auto quick clone +874 auto quick clone +875 auto quick clone +876 auto quick clone +877 auto quick clone
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH v4 10/11 reflink: test a big CoW operation
In reply to Darrick J. WongTest what happens when we send largeish buffers to CoW all at once.
--- tests/generic/878 | 99 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/878.out | 13 ++++++ tests/generic/879 | 99 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/879.out | 13 ++++++ tests/generic/group | 2 + 5 files changed, 226 insertions(+) create mode 100755 tests/generic/878 create mode 100644 tests/generic/878.out create mode 100755 tests/generic/879 create mode 100644 tests/generic/879.out
tests/generic/878 new file +99 -0
@@ -0,0 +1,99 @@ +#! /bin/bash +# FS QA Test No. 878 +# +# Reflink two large files and CoW them in big chunks. +# +# This test is dependent on the system page size, so we cannot use md5 in +# the golden output; we can only compare to a check file. +# +#----------------------------------------------------------------------- +# Copyright (c) 2015, Oracle and/or its affiliates. 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".* "$TESTDIR" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +TESTDIR="$SCRATCH_MNT/test-$seq" +rm -rf $TESTDIR +mkdir $TESTDIR + +BLKSZ=65536 +NR=6400 +BSZ=1280 + +FREE_BLOCKS=$(stat -f -c '%a' "$TESTDIR") +REAL_BLKSZ=$(stat -f -c '%S' "$TESTDIR") +SPACE_NEEDED=$(((BLKSZ * NR * 3) * 5 / 4)) +SPACE_AVAIL=$((FREE_BLOCKS * REAL_BLKSZ)) +test $SPACE_NEEDED -gt $SPACE_AVAIL && _notrun "Not enough space. $SPACE_AVAIL < $SPACE_NEEDED" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((BLKSZ * BSZ)) 0 $((BLKSZ * NR))" "$TESTDIR/file1" >> "$seqres.full" +_cp_reflink "$TESTDIR/file1" "$TESTDIR/file2" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((BLKSZ * BSZ)) 0 $((BLKSZ * NR))" "$TESTDIR/file2.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$TESTDIR/file1" | _filter_scratch +md5sum "$TESTDIR/file2" | _filter_scratch +md5sum "$TESTDIR/file2.chk" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((BLKSZ * BSZ)) 0 $((BLKSZ * NR))" "$TESTDIR/file2" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((BLKSZ * BSZ)) 0 $((BLKSZ * NR))" "$TESTDIR/file2.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$TESTDIR/file1" | _filter_scratch +md5sum "$TESTDIR/file2" | _filter_scratch +md5sum "$TESTDIR/file2.chk" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" +_check_scratch_fs + +# success, all done +status=0 +exit
tests/generic/878.out new file +13 -0
@@ -0,0 +1,13 @@ +QA output created by 878 +Format and mount +Create the original files +Compare files +01768a16d33c9bd21dc67a7fac006ee1 SCRATCH_MNT/test-878/file1 +01768a16d33c9bd21dc67a7fac006ee1 SCRATCH_MNT/test-878/file2 +01768a16d33c9bd21dc67a7fac006ee1 SCRATCH_MNT/test-878/file2.chk +CoW and unmount +Compare files +01768a16d33c9bd21dc67a7fac006ee1 SCRATCH_MNT/test-878/file1 +c835fd53fa27b72511b250d51595c053 SCRATCH_MNT/test-878/file2 +c835fd53fa27b72511b250d51595c053 SCRATCH_MNT/test-878/file2.chk +Check for damage
tests/generic/879 new file +99 -0
99 lines not on this page · raw message
tests/generic/879.out new file +13 -0
@@ -0,0 +1,13 @@ +QA output created by 879 +Format and mount +Create the original files +Compare files +01768a16d33c9bd21dc67a7fac006ee1 SCRATCH_MNT/test-879/file1 +01768a16d33c9bd21dc67a7fac006ee1 SCRATCH_MNT/test-879/file2 +01768a16d33c9bd21dc67a7fac006ee1 SCRATCH_MNT/test-879/file2.chk +CoW and unmount +Compare files +01768a16d33c9bd21dc67a7fac006ee1 SCRATCH_MNT/test-879/file1 +c835fd53fa27b72511b250d51595c053 SCRATCH_MNT/test-879/file2 +c835fd53fa27b72511b250d51595c053 SCRATCH_MNT/test-879/file2.chk +Check for damage
tests/generic/group +2 -0
@@ -289,3 +289,5 @@ 875 auto quick clone 876 auto quick clone 877 auto quick clone +878 auto quick clone +879 auto quick clone
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH v4 11/11 generic: create a dedupe group
In reply to Darrick J. WongCreate a group for just the deduplication tests.
--- tests/generic/group | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
tests/generic/group +9 -9
@@ -123,8 +123,8 @@ 118 auto quick clone 119 auto quick clone 120 other auto quick -121 auto quick clone -122 auto quick clone +121 auto quick clone dedupe +122 auto quick clone dedupe 123 perms auto quick 124 pattern auto quick 125 other auto
@@ -138,8 +138,8 @@ 133 rw auto 134 auto quick clone 135 metadata auto quick -136 auto quick clone -137 auto quick clone +136 auto quick clone dedupe +137 auto quick clone dedupe 138 auto quick clone 139 auto quick clone 140 auto quick clone
@@ -160,12 +160,12 @@ 155 auto quick clone 156 auto quick clone 157 auto quick clone -158 auto quick clone +158 auto quick clone dedupe 159 auto quick clone -160 auto quick clone +160 auto quick clone dedupe 161 auto quick clone -162 auto quick clone -163 auto quick clone +162 auto quick clone dedupe +163 auto quick clone dedupe 164 auto quick clone 165 auto quick clone 166 auto quick clone
@@ -261,7 +261,7 @@ 847 auto quick clone 848 auto quick clone 849 auto quick clone -850 auto quick clone +850 auto quick clone dedupe 851 auto quick clone 852 auto quick clone 853 auto quick clone
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs