Skip to contentSkip to conversation

xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls

PATCH In review Darrick J. Wong 2 participants 19 messages Nov 11, 2015 – Nov 13, 2015 Btrfs file system

lore
Share & tools
lore
#0 lore raw

cover xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls

Hi all,

This is part of the third revision of an RFC for adding to XFS support for tracking reverse-mappings of physical blocks to file and metadata; and support for mapping multiple file logical blocks to the same physical block, more commonly known as reflinking.

This patchset aims to make xfstests perform more rigorous testing of the NFS/CIFS/ocfs2/btrfs/XFS file clone, reflink, and dedupe ioctls. There are now tests of the basic functionality of the three ioctls; tests to ensure that the filesystem exhibits the expected copy on write semantics; tests to try to suss out race conditions in the new write paths; tests to ensure that the ioctls peform basic disk accounting correctly; tests of the interaction between reflink and the various fallocate verbs (allocate, punch, collapse, insert zeroes); and some attempts to test the upper limits of reflinking and ENOSPC behavior.

Since the last posting, each test tries to reflink (or dedupe) on the test or scratch FS to decide if they're going to run, instead of guessing based on FS type. Per Dave's suggestion, I also converted the basic functionality tests to use fixed sizes so that I can use md5sum in the golden output to check that the file contents match exactly.

Issues:

* I think the race checks for dedupe could be a little sharper at finding mistakes.

* The realtime reflink test (xfs/804) crashes XFS before we even get to the reflink attempt.

* I started the numbering really high to prevent the tests from colliding with whatever new tests might arrive; this will require some intervention to fix.

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], and xfs-docs[4]. They should just work with the btrfs that's in 4.3... and somewhat buggily with the 4.3 XFS patched with [1].

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

#1 lore raw

PATCH 1/11 btrfs: move btrfs reflink tests to generic

Move the cp --reflink tests from btrfs/ to generic/ since xfs now supports that ioctl.

---
 tests/btrfs/026       |   92 -----------------------------------------
 tests/btrfs/026.out   |   16 -------
 tests/btrfs/027       |  109 -------------------------------------------------
 tests/btrfs/027.out   |   25 -----------
 tests/btrfs/028       |   83 -------------------------------------
 tests/btrfs/028.out   |    7 ---
 tests/btrfs/group     |    3 -
 tests/generic/800     |   92 +++++++++++++++++++++++++++++++++++++++++
 tests/generic/800.out |   16 +++++++
 tests/generic/801     |  109 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/801.out |   25 +++++++++++
 tests/generic/802     |   83 +++++++++++++++++++++++++++++++++++++
 tests/generic/802.out |    7 +++
 tests/generic/group   |    3 +
 14 files changed, 335 insertions(+), 335 deletions(-)
 delete mode 100755 tests/btrfs/026
 delete mode 100644 tests/btrfs/026.out
 delete mode 100755 tests/btrfs/027
 delete mode 100644 tests/btrfs/027.out
 delete mode 100755 tests/btrfs/028
 delete mode 100644 tests/btrfs/028.out
 create mode 100755 tests/generic/800
 create mode 100644 tests/generic/800.out
 create mode 100755 tests/generic/801
 create mode 100644 tests/generic/801.out
 create mode 100755 tests/generic/802
 create mode 100644 tests/generic/802.out
tests/btrfs/026 deleted +0 -92
deleted file mode 100755
index 7559ca2..0000000
@@ -1,92 +0,0 @@
-#! /bin/bash
-# FS QA Test No. 026
-#
-# Tests file clone functionality of btrfs ("reflinks"):
-#   - Reflink a file
-#   - Reflink the reflinked file
-#   - Modify the original file
-#   - Modify the reflinked file
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2014, 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 -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. common/rc
-. common/filter
-
-# real QA test starts here
-_supported_fs btrfs
-_supported_os Linux
-
-_require_xfs_io_command "fiemap"
-_require_cp_reflink
-_require_test
-
-TESTDIR1=$TEST_DIR/test-$seq
-rm -rf $TESTDIR1
-mkdir $TESTDIR1
-
-_checksum_files() {
-    for F in original copy1 copy2
-    do
-        md5sum $TESTDIR1/$F | _filter_test_dir
-    done
-}
-
-rm -f $seqres.full
-
-echo "Create the original file and reflink to copy1, copy2"
-$XFS_IO_PROG -f -c 'pwrite -S 0x61 0 9000' $TESTDIR1/original \
-    >> $seqres.full 2>&1
-cp --reflink $TESTDIR1/original $TESTDIR1/copy1
-cp --reflink $TESTDIR1/copy1 $TESTDIR1/copy2
-_verify_reflink $TESTDIR1/original $TESTDIR1/copy1
-_verify_reflink $TESTDIR1/original $TESTDIR1/copy2
-echo "Original md5sums:"
-_checksum_files
-
-echo "Overwrite original file with new data"
-$XFS_IO_PROG -c 'pwrite -S 0x62 0 9000' $TESTDIR1/original \
-    >> $seqres.full 2>&1
-echo "md5sums after overwriting original:"
-_checksum_files
-
-echo "Overwrite copy1 with different new data"
-$XFS_IO_PROG -c 'pwrite -S 0x63 0 9000' $TESTDIR1/copy1 \
-    >> $seqres.full 2>&1
-echo "md5sums after overwriting copy1:"
-_checksum_files
-
-# success, all done
-status=0
-exit
tests/btrfs/026.out deleted +0 -16
deleted file mode 100644
index 3b90ff0..0000000
@@ -1,16 +0,0 @@
-QA output created by 026
-Create the original file and reflink to copy1, copy2
-Original md5sums:
-42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-026/original
-42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-026/copy1
-42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-026/copy2
-Overwrite original file with new data
-md5sums after overwriting original:
-4a847a25439532bf48b68c9e9536ed5b  TEST_DIR/test-026/original
-42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-026/copy1
-42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-026/copy2
-Overwrite copy1 with different new data
-md5sums after overwriting copy1:
-4a847a25439532bf48b68c9e9536ed5b  TEST_DIR/test-026/original
-e271cd47d9f62ebc96cb4e67ae4d16db  TEST_DIR/test-026/copy1
-42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-026/copy2
tests/btrfs/027 deleted +0 -109

109 lines not on this page · raw message

tests/btrfs/027.out deleted +0 -25
deleted file mode 100644
index 7b7e3bb..0000000
@@ -1,25 +0,0 @@
-QA output created by 027
-Create the original files and reflink dirs
-Original md5sums:
-42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-027/original/file1
-ca390545f0aedb54b808d6128c56a7dd  TEST_DIR/test-027/original/subdir/file2
-42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-027/copy1/file1
-ca390545f0aedb54b808d6128c56a7dd  TEST_DIR/test-027/copy1/subdir/file2
-42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-027/copy2/file1
-ca390545f0aedb54b808d6128c56a7dd  TEST_DIR/test-027/copy2/subdir/file2
-Overwrite original/file1 and original/subdir/file2 with new data
-md5sums now:
-260f6785c0537fd12582dcae28a3c1a9  TEST_DIR/test-027/original/file1
-b8d91fb600f6f2191f2ba66665374860  TEST_DIR/test-027/original/subdir/file2
-42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-027/copy1/file1
-ca390545f0aedb54b808d6128c56a7dd  TEST_DIR/test-027/copy1/subdir/file2
-42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-027/copy2/file1
-ca390545f0aedb54b808d6128c56a7dd  TEST_DIR/test-027/copy2/subdir/file2
-Overwrite copy1/file1 and copy1/subdir/file2 with new data
-md5sums now:
-260f6785c0537fd12582dcae28a3c1a9  TEST_DIR/test-027/original/file1
-b8d91fb600f6f2191f2ba66665374860  TEST_DIR/test-027/original/subdir/file2
-b20229a003e3985c4b0e6806abcd6642  TEST_DIR/test-027/copy1/file1
-b815b24069db14e0a3a07169fd563e93  TEST_DIR/test-027/copy1/subdir/file2
-42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-027/copy2/file1
-ca390545f0aedb54b808d6128c56a7dd  TEST_DIR/test-027/copy2/subdir/file2
tests/btrfs/028 deleted +0 -83

83 lines not on this page · raw message

tests/btrfs/028.out deleted +0 -7
deleted file mode 100644
index f683fce..0000000
@@ -1,7 +0,0 @@
-QA output created by 028
-Create the original files and reflink dirs
-Move orig & reflink copy to subdir and md5sum:
-42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-028/subdir/original_moved
-42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-028/subdir/copy_moved
-remove orig from subdir and md5sum reflink copy:
-42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-028/subdir/copy_moved
tests/btrfs/group +0 -3
index 7cf7dd7..c5d529f 100644
@@ -28,9 +28,6 @@
 023 auto
 024 auto quick compress
 025 auto quick send clone
-026 auto quick clone
-027 auto quick clone
-028 auto quick clone
 029 auto quick clone
 030 auto quick send
 031 auto quick subvol clone
tests/generic/800 new file +92 -0

92 lines not on this page · raw message

tests/generic/800.out new file +16 -0
new file mode 100644
index 0000000..6978d71
@@ -0,0 +1,16 @@
+QA output created by 800
+Create the original file and reflink to copy1, copy2
+Original md5sums:
+42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-800/original
+42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-800/copy1
+42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-800/copy2
+Overwrite original file with new data
+md5sums after overwriting original:
+4a847a25439532bf48b68c9e9536ed5b  TEST_DIR/test-800/original
+42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-800/copy1
+42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-800/copy2
+Overwrite copy1 with different new data
+md5sums after overwriting copy1:
+4a847a25439532bf48b68c9e9536ed5b  TEST_DIR/test-800/original
+e271cd47d9f62ebc96cb4e67ae4d16db  TEST_DIR/test-800/copy1
+42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-800/copy2
tests/generic/801 new file +109 -0

109 lines not on this page · raw message

tests/generic/801.out new file +25 -0
new file mode 100644
index 0000000..b8225cc
@@ -0,0 +1,25 @@
+QA output created by 801
+Create the original files and reflink dirs
+Original md5sums:
+42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-801/original/file1
+ca390545f0aedb54b808d6128c56a7dd  TEST_DIR/test-801/original/subdir/file2
+42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-801/copy1/file1
+ca390545f0aedb54b808d6128c56a7dd  TEST_DIR/test-801/copy1/subdir/file2
+42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-801/copy2/file1
+ca390545f0aedb54b808d6128c56a7dd  TEST_DIR/test-801/copy2/subdir/file2
+Overwrite original/file1 and original/subdir/file2 with new data
+md5sums now:
+260f6785c0537fd12582dcae28a3c1a9  TEST_DIR/test-801/original/file1
+b8d91fb600f6f2191f2ba66665374860  TEST_DIR/test-801/original/subdir/file2
+42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-801/copy1/file1
+ca390545f0aedb54b808d6128c56a7dd  TEST_DIR/test-801/copy1/subdir/file2
+42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-801/copy2/file1
+ca390545f0aedb54b808d6128c56a7dd  TEST_DIR/test-801/copy2/subdir/file2
+Overwrite copy1/file1 and copy1/subdir/file2 with new data
+md5sums now:
+260f6785c0537fd12582dcae28a3c1a9  TEST_DIR/test-801/original/file1
+b8d91fb600f6f2191f2ba66665374860  TEST_DIR/test-801/original/subdir/file2
+b20229a003e3985c4b0e6806abcd6642  TEST_DIR/test-801/copy1/file1
+b815b24069db14e0a3a07169fd563e93  TEST_DIR/test-801/copy1/subdir/file2
+42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-801/copy2/file1
+ca390545f0aedb54b808d6128c56a7dd  TEST_DIR/test-801/copy2/subdir/file2
tests/generic/802 new file +83 -0

83 lines not on this page · raw message

tests/generic/802.out new file +7 -0
new file mode 100644
index 0000000..c20e16e
@@ -0,0 +1,7 @@
+QA output created by 802
+Create the original files and reflink dirs
+Move orig & reflink copy to subdir and md5sum:
+42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-802/subdir/original_moved
+42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-802/subdir/copy_moved
+remove orig from subdir and md5sum reflink copy:
+42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-802/subdir/copy_moved
tests/generic/group +3 -0
index 1dd4269..d9421c5 100644
@@ -208,3 +208,6 @@
 323 auto aio stress
 324 auto fsr quick
 325 auto quick data log
+800 auto quick clone
+801 auto quick clone
+802 auto quick clone

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#2 lore raw

PATCH 2/11 generic/80[0-2]: support xfs in addition to btrfs

In reply to Darrick J. Wong

Modify the reflink tests to support xfs.

---
 common/rc         |   42 ++++++------
 common/reflink    |  179 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/btrfs/029   |    1 
 tests/btrfs/031   |    1 
 tests/btrfs/108   |    1 
 tests/btrfs/109   |    1 
 tests/generic/800 |    3 +
 tests/generic/801 |    3 +
 tests/generic/802 |    3 +
 9 files changed, 210 insertions(+), 24 deletions(-)
 create mode 100644 common/reflink
common/rc +21 -21
index adf1edf..c016673 100644
@@ -82,6 +82,27 @@ _md5_checksum()
 	md5sum $1 | cut -d ' ' -f1
 }
 
+# Write a byte into a range of a file
+_pwrite_byte() {
+	pattern="$1"
+	offset="$2"
+	len="$3"
+	file="$4"
+	xfs_io_args="$5"
+
+	"$XFS_IO_PROG" $xfs_io_args -f -c "pwrite -S $pattern $offset $len" "$file"
+}
+
+# mmap-write a byte into a range of a file
+_mwrite_byte() {
+	pattern="$1"
+	offset="$2"
+	len="$3"
+	mmap_len="$4"
+	file="$5"
+
+	"$XFS_IO_PROG" -f -c "mmap -rw 0 $mmap_len" -c "pwrite -S $pattern $offset $len" "$file"
+}
 
 # ls -l w/ selinux sometimes puts a dot at the end:
 # -rwxrw-r--. id1 id2 file1
@@ -2569,12 +2590,6 @@ _require_ugid_map()
 	fi
 }
 
-_require_cp_reflink()
-{
-       cp --help | grep -q reflink || \
-               _notrun "This test requires a cp with --reflink support."
-}
-
 _require_fssum()
 {
 	FSSUM_PROG=$here/src/fssum
@@ -2588,21 +2603,6 @@ _require_cloner()
 		_notrun "cloner binary not present at $CLONER_PROG"
 }
 
-# Given 2 files, verify that they have the same mapping but different
-# inodes - i.e. an undisturbed reflink
-# Silent if so, make noise if not
-_verify_reflink()
-{
-       # not a hard link or symlink?
-       cmp -s  <(stat -c '%i' $1) <(stat -c '%i' $2) \
-               && echo "$1 and $2 are not reflinks: same inode number"
-
-       # same mapping?
-       diff -u <($XFS_IO_PROG -c "fiemap" $1 | grep -v $1) \
-               <($XFS_IO_PROG -c "fiemap" $2 | grep -v $2) \
-               || echo "$1 and $2 are not reflinks: different extents"
-}
-
 _require_atime()
 {
 	if [ "$FSTYP" == "nfs" ]; then
common/reflink new file +179 -0

179 lines not on this page · raw message

tests/btrfs/029 +1 -0
index 0b77b33..175317a 100755
@@ -47,6 +47,7 @@ _cleanup()
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
+. ./common/reflink
 
 # real QA test starts here
 _supported_fs btrfs
tests/btrfs/031 +1 -0
index bcd332c..c5763da 100755
@@ -48,6 +48,7 @@ _cleanup()
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
+. ./common/reflink
 
 # real QA test starts here
 _supported_fs btrfs
tests/btrfs/108 +1 -0
index 5e3a403..18e5b99 100755
@@ -41,6 +41,7 @@ _cleanup()
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
+. ./common/reflink
 
 # real QA test starts here
 _supported_fs btrfs
tests/btrfs/109 +1 -0
index e2aeb73..b86336c 100755
@@ -41,6 +41,7 @@ _cleanup()
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
+. ./common/reflink
 
 # real QA test starts here
 _supported_fs btrfs
tests/generic/800 +2 -1
index a71f11a..1e73c33 100755
@@ -43,9 +43,10 @@ _cleanup()
 # get standard environment, filters and checks
 . common/rc
 . common/filter
+. common/reflink
 
 # real QA test starts here
-_supported_fs btrfs
+_require_test_reflink
 _supported_os Linux
 
 _require_xfs_io_command "fiemap"
tests/generic/801 +2 -1
index b21c44b..2facea9 100755
@@ -43,9 +43,10 @@ _cleanup()
 # get standard environment, filters and checks
 . common/rc
 . common/filter
+. common/reflink
 
 # real QA test starts here
-_supported_fs btrfs
+_require_test_reflink
 _supported_os Linux
 
 _require_xfs_io_command "fiemap"
tests/generic/802 +2 -1
index afd8513..aaca2b4 100755
@@ -41,9 +41,10 @@ _cleanup()
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
+. ./common/reflink
 
 # real QA test starts here
-_supported_fs btrfs
+_require_test_reflink
 _supported_os Linux
 
 _require_xfs_io_command "fiemap"

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#3 lore raw

PATCH 3/11 reflink: basic tests of the reflink and dedupe ioctls

In reply to Darrick J. Wong

Test the operation of the btrfs (and now xfs) reflink and dedupe ioctls at various file offsets and with matching and nonmatching files.

---
 tests/generic/803     |   92 +++++++++++++++++++++++++++
 tests/generic/803.out |    8 ++
 tests/generic/804     |   93 +++++++++++++++++++++++++++
 tests/generic/804.out |   11 +++
 tests/generic/805     |  170 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/805.out |   30 +++++++++
 tests/generic/806     |   92 +++++++++++++++++++++++++++
 tests/generic/806.out |    8 ++
 tests/generic/807     |   92 +++++++++++++++++++++++++++
 tests/generic/807.out |   12 +++
 tests/generic/817     |  128 +++++++++++++++++++++++++++++++++++++
 tests/generic/817.out |   16 +++++
 tests/generic/818     |  128 +++++++++++++++++++++++++++++++++++++
 tests/generic/818.out |   17 +++++
 tests/generic/819     |  131 ++++++++++++++++++++++++++++++++++++++
 tests/generic/819.out |    8 ++
 tests/generic/group   |    8 ++
 17 files changed, 1044 insertions(+)
 create mode 100755 tests/generic/803
 create mode 100644 tests/generic/803.out
 create mode 100755 tests/generic/804
 create mode 100644 tests/generic/804.out
 create mode 100755 tests/generic/805
 create mode 100644 tests/generic/805.out
 create mode 100755 tests/generic/806
 create mode 100644 tests/generic/806.out
 create mode 100755 tests/generic/807
 create mode 100644 tests/generic/807.out
 create mode 100755 tests/generic/817
 create mode 100644 tests/generic/817.out
 create mode 100755 tests/generic/818
 create mode 100644 tests/generic/818.out
 create mode 100755 tests/generic/819
 create mode 100644 tests/generic/819.out
tests/generic/803 new file +92 -0
new file mode 100755
index 0000000..14c9e98
@@ -0,0 +1,92 @@
+#! /bin/bash
+# FS QA Test No. 803
+#
+# Ensure that we can reflink parts of two identical files:
+#   - Reflink identical parts of two identical files
+#   - Check that we still have identical contents
+#
+#-----------------------------------------------------------------------
+# 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
+
+rm -f "$seqres.full"
+
+TESTDIR="$TEST_DIR/test-$seq"
+rm -rf "$TESTDIR"
+mkdir "$TESTDIR"
+
+echo "Create the original files"
+BLKSZ=65536
+_pwrite_byte 0x61 $((BLKSZ * 2)) $((BLKSZ * 6)) "$TESTDIR/file1" >> "$seqres.full"
+_pwrite_byte 0x61 $((BLKSZ * 2)) $((BLKSZ * 6)) "$TESTDIR/file2" >> "$seqres.full"
+_test_remount
+
+md5sum "$TESTDIR/file1" | _filter_test_dir
+md5sum "$TESTDIR/file2" | _filter_test_dir
+
+_compare_range "$TESTDIR/file1" 0 "$TESTDIR/file2" 0 $((BLKSZ * 8)) \
+       || echo "Files do not match"
+
+echo "Reflink the middle blocks together"
+free_before="$(stat -f -c '%a' "$TESTDIR")"
+_reflink_range "$TESTDIR/file1" $((BLKSZ * 4)) "$TESTDIR/file2" \
+		$((BLKSZ * 4)) $((BLKSZ * 2)) >> "$seqres.full"
+_test_remount
+free_after="$(stat -f -c '%a' "$TESTDIR")"
+echo "freesp changed by $free_before -> $free_after" >> "$seqres.full"
+
+echo "Compare sections"
+md5sum "$TESTDIR/file1" | _filter_test_dir
+md5sum "$TESTDIR/file2" | _filter_test_dir
+
+_compare_range "$TESTDIR/file1" 0 "$TESTDIR/file2" 0 $((BLKSZ * 4)) \
+       || echo "Start sections do not match"
+
+_compare_range "$TESTDIR/file1" $((BLKSZ * 4)) "$TESTDIR/file2" \
+		$((BLKSZ * 4)) $((BLKSZ * 2)) \
+       || echo "Middle sections do not match"
+
+_compare_range "$TESTDIR/file1" $((BLKSZ * 6)) "$TESTDIR/file2" \
+		$((BLKSZ * 6)) $((BLKSZ * 2)) \
+       || echo "End sections do not match"
+
+# success, all done
+status=0
+exit
tests/generic/803.out new file +8 -0
new file mode 100644
index 0000000..09099aa
@@ -0,0 +1,8 @@
+QA output created by 803
+Create the original files
+35ac8d7917305c385c30f3d82c30a8f6  TEST_DIR/test-803/file1
+35ac8d7917305c385c30f3d82c30a8f6  TEST_DIR/test-803/file2
+Reflink the middle blocks together
+Compare sections
+35ac8d7917305c385c30f3d82c30a8f6  TEST_DIR/test-803/file1
+35ac8d7917305c385c30f3d82c30a8f6  TEST_DIR/test-803/file2
tests/generic/804 new file +93 -0

93 lines not on this page · raw message

tests/generic/804.out new file +11 -0
new file mode 100644
index 0000000..ad40ca2
@@ -0,0 +1,11 @@
+QA output created by 804
+Create the original files
+35ac8d7917305c385c30f3d82c30a8f6  TEST_DIR/test-804/file1
+5e3501f97fd2669babfcbd3e1972e833  TEST_DIR/test-804/file2
+Files do not match (intentional)
+Reflink the middle blocks together
+Compare sections
+35ac8d7917305c385c30f3d82c30a8f6  TEST_DIR/test-804/file1
+f7f9e44d37909868014e9151f5293ab0  TEST_DIR/test-804/file2
+Start sections do not match (intentional)
+End sections do not match (intentional)
tests/generic/805 new file +170 -0

170 lines not on this page · raw message

tests/generic/805.out new file +30 -0
new file mode 100644
index 0000000..82f9658
@@ -0,0 +1,30 @@
+QA output created by 805
+Create the original files
+30c2557e8302a5beb290c71520d87f42  TEST_DIR/test-805/file1
+efb787f7990e43c7dc30565d8cc344d4  TEST_DIR/test-805/file2
+c83f38d4622a78b74e3480634194b08f  TEST_DIR/test-805/file3
+1c11fd3151d2229f5cf43903386aa432  TEST_DIR/test-805/file4
+Files 1-2 do not match (intentional)
+Files 1-3 do not match (intentional)
+Files 1-4 do not match (intentional)
+Reflink the first four blocks together, 1-2 3-4
+Compare sections
+30c2557e8302a5beb290c71520d87f42  TEST_DIR/test-805/file1
+63bdb182cdf03a8a19e83234d869d00a  TEST_DIR/test-805/file2
+c83f38d4622a78b74e3480634194b08f  TEST_DIR/test-805/file3
+dc2ae3db14e97fad93faf939170b085c  TEST_DIR/test-805/file4
+Sections of file 1-3 do not match (intentional)
+Sections of file 1-4 do not match (intentional)
+Sections of file 2-3 do not match (intentional)
+Sections of file 2-4 do not match (intentional)
+Reflink the first two blocks together, 1-3 1-4
+Compare sections
+30c2557e8302a5beb290c71520d87f42  TEST_DIR/test-805/file1
+63bdb182cdf03a8a19e83234d869d00a  TEST_DIR/test-805/file2
+89a444ff9d6af60ba487e9a0ca2161e2  TEST_DIR/test-805/file3
+0c263058794a54c5e197ece52386f5be  TEST_DIR/test-805/file4
+Compare previously reflinked sections
+Sections of file 1-3 do not match (intentional)
+Sections of file 1-4 do not match (intentional)
+Sections of file 2-3 do not match (intentional)
+Sections of file 2-4 do not match (intentional)
tests/generic/806 new file +92 -0

92 lines not on this page · raw message

tests/generic/806.out new file +8 -0
new file mode 100644
index 0000000..781b545
@@ -0,0 +1,8 @@
+QA output created by 806
+Create the original files
+35ac8d7917305c385c30f3d82c30a8f6  TEST_DIR/test-806/file1
+35ac8d7917305c385c30f3d82c30a8f6  TEST_DIR/test-806/file2
+Dedupe the middle blocks together
+Compare sections
+35ac8d7917305c385c30f3d82c30a8f6  TEST_DIR/test-806/file1
+35ac8d7917305c385c30f3d82c30a8f6  TEST_DIR/test-806/file2
tests/generic/807 new file +92 -0

92 lines not on this page · raw message

tests/generic/807.out new file +12 -0
new file mode 100644
index 0000000..424d039
@@ -0,0 +1,12 @@
+QA output created by 807
+Create the original files
+35ac8d7917305c385c30f3d82c30a8f6  TEST_DIR/test-807/file1
+5e3501f97fd2669babfcbd3e1972e833  TEST_DIR/test-807/file2
+Files 1-2 do not match (intentional)
+(Fail to) dedupe the middle blocks together
+Compare sections
+35ac8d7917305c385c30f3d82c30a8f6  TEST_DIR/test-807/file1
+5e3501f97fd2669babfcbd3e1972e833  TEST_DIR/test-807/file2
+Start sections do not match (intentional)
+Middle sections do not match (intentional)
+End sections do not match (intentional)
tests/generic/817 new file +128 -0

128 lines not on this page · raw message

tests/generic/817.out new file +16 -0
new file mode 100644
index 0000000..dd6b1ee
@@ -0,0 +1,16 @@
+QA output created by 817
+Create the original files
+c4fd505be25a0c91bcca9f502b9a8156  TEST_DIR/test-817/file1
+c4fd505be25a0c91bcca9f502b9a8156  TEST_DIR/test-817/file2
+07ac67bf7f271195442509e79cde4cee  TEST_DIR/test-817/file3
+07ac67bf7f271195442509e79cde4cee  TEST_DIR/test-817/file4
+Reflink the last blocks together, 1-2 1-3
+c4fd505be25a0c91bcca9f502b9a8156  TEST_DIR/test-817/file1
+c4fd505be25a0c91bcca9f502b9a8156  TEST_DIR/test-817/file2
+e236f2fe789f0aa34b50e981a2f0243a  TEST_DIR/test-817/file3
+07ac67bf7f271195442509e79cde4cee  TEST_DIR/test-817/file4
+Compare files
+Compare sections
+End sections of files 1-4 do not match (intentional)
+End sections of files 2-4 do not match (intentional)
+End sections of files 3-4 do not match (intentional)
tests/generic/818 new file +128 -0

128 lines not on this page · raw message

tests/generic/818.out new file +17 -0
new file mode 100644
index 0000000..f7e30bf
@@ -0,0 +1,17 @@
+QA output created by 818
+Create the original files
+c4fd505be25a0c91bcca9f502b9a8156  TEST_DIR/test-818/file1
+c4fd505be25a0c91bcca9f502b9a8156  TEST_DIR/test-818/file2
+07ac67bf7f271195442509e79cde4cee  TEST_DIR/test-818/file3
+07ac67bf7f271195442509e79cde4cee  TEST_DIR/test-818/file4
+Dedupe the last blocks together
+c4fd505be25a0c91bcca9f502b9a8156  TEST_DIR/test-818/file1
+c4fd505be25a0c91bcca9f502b9a8156  TEST_DIR/test-818/file2
+07ac67bf7f271195442509e79cde4cee  TEST_DIR/test-818/file3
+07ac67bf7f271195442509e79cde4cee  TEST_DIR/test-818/file4
+Compare files
+Compare sections
+End sections of files 1-3 do not match (intentional)
+End sections of files 1-4 do not match (intentional)
+End sections of files 2-3 do not match (intentional)
+End sections of files 2-4 do not match (intentional)
tests/generic/819 new file +131 -0

131 lines not on this page · raw message

tests/generic/819.out new file +8 -0
new file mode 100644
index 0000000..203275d
@@ -0,0 +1,8 @@
+QA output created by 819
+Create the original file blocks
+fallocate half the file
+Reflink block zero to the threes
+Reflink block one to the fives
+Dedupe block two to the sevens
+Check block mappings
+2ea37912bdbd71b9ed4734d3141cbe9c  TEST_DIR/test-819/file1
tests/generic/group +8 -0
index d9421c5..7f25037 100644
@@ -211,3 +211,11 @@
 800 auto quick clone
 801 auto quick clone
 802 auto quick clone
+803 auto quick clone
+804 auto quick clone
+805 auto quick clone
+806 auto quick clone
+807 auto quick clone
+817 auto quick clone
+818 auto quick clone
+819 auto quick clone

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#4 lore raw

PATCH 4/11 reflink: test CoW behaviors of reflinked files

In reply to Darrick J. Wong

Ensure that CoW happens correctly with buffered, directio, and mmap writes.

---
 tests/generic/808     |  152 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/808.out |   19 ++++++
 tests/generic/809     |  151 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/809.out |   19 ++++++
 tests/generic/810     |  152 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/810.out |   19 ++++++
 tests/generic/837     |   91 +++++++++++++++++++++++++++++
 tests/generic/837.out |    8 +++
 tests/generic/838     |   91 +++++++++++++++++++++++++++++
 tests/generic/838.out |    8 +++
 tests/generic/group   |    5 ++
 11 files changed, 715 insertions(+)
 create mode 100755 tests/generic/808
 create mode 100644 tests/generic/808.out
 create mode 100755 tests/generic/809
 create mode 100644 tests/generic/809.out
 create mode 100755 tests/generic/810
 create mode 100644 tests/generic/810.out
 create mode 100755 tests/generic/837
 create mode 100644 tests/generic/837.out
 create mode 100755 tests/generic/838
 create mode 100644 tests/generic/838.out
tests/generic/808 new file +152 -0
new file mode 100755
index 0000000..3a3ec58
@@ -0,0 +1,152 @@
+#! /bin/bash
+# FS QA Test No. 808
+#
+# Ensuring that copy on write through the page cache works:
+#   - Reflink two files together
+#   - Write to the beginning, middle, and end
+#   - 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_test_reflink
+_require_cp_reflink
+
+rm -f "$seqres.full"
+
+TESTDIR="$TEST_DIR/test-$seq"
+rm -rf "$TESTDIR"
+mkdir "$TESTDIR"
+
+echo "Create the original files"
+BLKSZ=65536
+_pwrite_byte 0x61 0 $((BLKSZ * 48 - 3)) "$TESTDIR/file1" >> "$seqres.full"
+_cp_reflink "$TESTDIR/file1" "$TESTDIR/file2" >> "$seqres.full"
+_pwrite_byte 0x61 0 $((BLKSZ * 48 - 3)) "$TESTDIR/file3" >> "$seqres.full"
+_test_remount
+
+echo "Compare files"
+md5sum "$TESTDIR/file1" | _filter_test_dir
+md5sum "$TESTDIR/file2" | _filter_test_dir
+md5sum "$TESTDIR/file3" | _filter_test_dir
+
+cmp -s "$TESTDIR/file1" "$TESTDIR/file2" || echo "Files 1-2 do not match"
+cmp -s "$TESTDIR/file1" "$TESTDIR/file3" || echo "Files 1-3 do not match"
+cmp -s "$TESTDIR/file2" "$TESTDIR/file3" || echo "Files 2-3 do not match"
+
+echo "pagecache CoW the second file"
+_pwrite_byte 0x62 0 17 "$TESTDIR/file2" >> "$seqres.full"
+_pwrite_byte 0x62 0 17 "$TESTDIR/file3" >> "$seqres.full"
+
+_pwrite_byte 0x62 $((BLKSZ * 16 - 34)) 17 "$TESTDIR/file2" >> "$seqres.full"
+_pwrite_byte 0x62 $((BLKSZ * 16 - 34)) 17 "$TESTDIR/file3" >> "$seqres.full"
+
+_pwrite_byte 0x62 $((BLKSZ * 48 - 8)) 17 "$TESTDIR/file2" >> "$seqres.full"
+_pwrite_byte 0x62 $((BLKSZ * 48 - 8)) 17 "$TESTDIR/file3" >> "$seqres.full"
+_test_remount
+
+echo "Compare files"
+md5sum "$TESTDIR/file1" | _filter_test_dir
+md5sum "$TESTDIR/file2" | _filter_test_dir
+md5sum "$TESTDIR/file3" | _filter_test_dir
+
+cmp -s "$TESTDIR/file1" "$TESTDIR/file2" || echo "Files 1-2 do not match (intentional)"
+cmp -s "$TESTDIR/file1" "$TESTDIR/file3" || echo "Files 1-3 do not match (intentional)"
+cmp -s "$TESTDIR/file2" "$TESTDIR/file3" || echo "Files 2-3 do not match"
+
+echo "Compare the CoW'd section to the before file"
+_compare_range "$TESTDIR/file1" 0 "$TESTDIR/file2" 0 17 \
+       || echo "Start sections do not match (intentional)"
+
+_compare_range  "$TESTDIR/file1" $((BLKSZ * 16 - 34)) \
+		"$TESTDIR/file2" $((BLKSZ * 16 - 34)) 17 \
+       || echo "Middle sections do not match (intentional)"
+
+_compare_range  "$TESTDIR/file1" $((BLKSZ * 48 - 8)) \
+		"$TESTDIR/file2" $((BLKSZ * 48 - 8)) 17 \
+       || echo "End sections do not match (intentional)"
+
+echo "Compare the CoW'd section to the after file"
+_compare_range "$TESTDIR/file2" 0 "$TESTDIR/file3" 0 17 \
+       || echo "Start sections do not match"
+
+_compare_range  "$TESTDIR/file2" $((BLKSZ * 16 - 34)) \
+		"$TESTDIR/file3" $((BLKSZ * 16 - 34)) 17 \
+       || echo "Middle sections do not match"
+
+_compare_range  "$TESTDIR/file2" $((BLKSZ * 48 - 8)) \
+		"$TESTDIR/file3" $((BLKSZ * 48 - 8)) 17 \
+       || echo "End sections do not match"
+
+echo "Compare the not CoW'd sections"
+_compare_range "$TESTDIR/file1" 18 "$TESTDIR/file2" 18 17 \
+       || echo "Start sections of 1-2 do not match"
+
+_compare_range "$TESTDIR/file2" 18 "$TESTDIR/file3" 18 17 \
+       || echo "Start sections of 2-3 do not match"
+
+
+_compare_range  "$TESTDIR/file1" $((BLKSZ * 16 - 17)) \
+		"$TESTDIR/file2" $((BLKSZ * 16 - 17)) 82 \
+       || echo "Middle sections of 1-2 do not match"
+
+_compare_range  "$TESTDIR/file2" $((BLKSZ * 16 - 17)) \
+		"$TESTDIR/file3" $((BLKSZ * 16 - 17)) 82 \
+       || echo "Middle sections of 2-3 do not match"
+
+_compare_range  "$TESTDIR/file1" $((BLKSZ * 48 - 108)) \
+		"$TESTDIR/file2" $((BLKSZ * 48 - 108)) 100 \
+       || echo "End sections of 1-2 do not match"
+
+_compare_range  "$TESTDIR/file2" $((BLKSZ * 48 - 108)) \
+		"$TESTDIR/file3" $((BLKSZ * 48 - 108)) 100 \
+       || echo "End sections of 2-3 do not match"
+
+
+_compare_range  "$TESTDIR/file1" $((BLKSZ * 14)) \
+		"$TESTDIR/file2" $((BLKSZ * 14)) $BLKSZ \
+       || echo "Untouched sections of 1-2 do not match"
+
+_compare_range  "$TESTDIR/file2" $((BLKSZ * 14)) \
+		"$TESTDIR/file3" $((BLKSZ * 14)) $BLKSZ \
+       || echo "Untouched sections of 2-3 do not match"
+
+# success, all done
+status=0
+exit
tests/generic/808.out new file +19 -0
new file mode 100644
index 0000000..1e82e2d
@@ -0,0 +1,19 @@
+QA output created by 808
+Create the original files
+Compare files
+60ebe700450b6015c17fa15cacb9493b  TEST_DIR/test-808/file1
+60ebe700450b6015c17fa15cacb9493b  TEST_DIR/test-808/file2
+60ebe700450b6015c17fa15cacb9493b  TEST_DIR/test-808/file3
+pagecache CoW the second file
+Compare files
+60ebe700450b6015c17fa15cacb9493b  TEST_DIR/test-808/file1
+4a879c2f322121f6f4b8ebede1909a7c  TEST_DIR/test-808/file2
+4a879c2f322121f6f4b8ebede1909a7c  TEST_DIR/test-808/file3
+Files 1-2 do not match (intentional)
+Files 1-3 do not match (intentional)
+Compare the CoW'd section to the before file
+Start sections do not match (intentional)
+Middle sections do not match (intentional)
+End sections do not match (intentional)
+Compare the CoW'd section to the after file
+Compare the not CoW'd sections
tests/generic/809 new file +151 -0

151 lines not on this page · raw message

tests/generic/809.out new file +19 -0
new file mode 100644
index 0000000..ad63e4e
@@ -0,0 +1,19 @@
+QA output created by 809
+Create the original files
+Compare files
+60ebe700450b6015c17fa15cacb9493b  TEST_DIR/test-809/file1
+60ebe700450b6015c17fa15cacb9493b  TEST_DIR/test-809/file2
+60ebe700450b6015c17fa15cacb9493b  TEST_DIR/test-809/file3
+directio CoW the second file
+Compare files
+60ebe700450b6015c17fa15cacb9493b  TEST_DIR/test-809/file1
+ff5626fb6c71b242d6b1a43de25c9a85  TEST_DIR/test-809/file2
+ff5626fb6c71b242d6b1a43de25c9a85  TEST_DIR/test-809/file3
+Files 1-2 should not match (intentional)
+Files 1-3 should not match (intentional)
+Compare the CoW'd section to the before file
+Start sections do not match (intentional)
+Middle sections do not match (intentional)
+End sections do not match (intentional)
+Compare the CoW'd section to the after file
+Compare the not CoW'd sections
tests/generic/810 new file +152 -0

152 lines not on this page · raw message

tests/generic/810.out new file +19 -0
new file mode 100644
index 0000000..8cc94ab
@@ -0,0 +1,19 @@
+QA output created by 810
+Create the original files
+Compare files
+60ebe700450b6015c17fa15cacb9493b  TEST_DIR/test-810/file1
+60ebe700450b6015c17fa15cacb9493b  TEST_DIR/test-810/file2
+60ebe700450b6015c17fa15cacb9493b  TEST_DIR/test-810/file3
+mmap CoW the second file
+Compare files
+60ebe700450b6015c17fa15cacb9493b  TEST_DIR/test-810/file1
+795ecfd281dbda4916431376228e4187  TEST_DIR/test-810/file2
+795ecfd281dbda4916431376228e4187  TEST_DIR/test-810/file3
+Files 1-2 do not match (intentional)
+Files 1-3 do not match (intentional)
+Compare the CoW'd section to the before file
+Start sections do not match (intentional)
+Middle sections do not match (intentional)
+End sections do not match (intentional)
+Compare the CoW'd section to the after file
+Compare the not CoW'd sections
tests/generic/837 new file +91 -0

91 lines not on this page · raw message

tests/generic/837.out new file +8 -0
new file mode 100644
index 0000000..3f9c2e5
@@ -0,0 +1,8 @@
+QA output created by 837
+Create the original file blocks
+f4820540fc0ac02750739896fe028d56  TEST_DIR/test-837/file1
+Create the reflink copies
+Rewrite the copies
+Examine original file
+f4820540fc0ac02750739896fe028d56  TEST_DIR/test-837/file1
+eb34153e9ed1e774db28cbbe4090a449  TEST_DIR/test-837/file2
tests/generic/838 new file +91 -0

91 lines not on this page · raw message

tests/generic/838.out new file +8 -0
new file mode 100644
index 0000000..cc44815
@@ -0,0 +1,8 @@
+QA output created by 838
+Create the original file blocks
+f4820540fc0ac02750739896fe028d56  TEST_DIR/test-838/file1
+Create the reflink copies
+Rewrite the copies
+Examine original file
+f4820540fc0ac02750739896fe028d56  TEST_DIR/test-838/file1
+eb34153e9ed1e774db28cbbe4090a449  TEST_DIR/test-838/file2
tests/generic/group +5 -0
index 7f25037..a72d416 100644
@@ -216,6 +216,11 @@
 805 auto quick clone
 806 auto quick clone
 807 auto quick clone
+808 auto quick clone
+809 auto quick clone
+810 auto quick clone
 817 auto quick clone
 818 auto quick clone
 819 auto quick clone
+837 auto quick clone
+838 auto quick clone

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#5 lore raw

PATCH 5/11 reflink: test the various fallocate modes

In reply to Darrick J. Wong

Check that the variants of fallocate (allocate, punch, zero range, collapse range, insert range) do the right thing when they're run against a range of reflinked blocks.

---
 tests/generic/811     |  142 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/811.out |   16 ++++++
 tests/generic/812     |  142 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/812.out |   19 +++++++
 tests/generic/813     |  136 +++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/813.out |   19 +++++++
 tests/generic/814     |  139 ++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/814.out |   19 +++++++
 tests/generic/815     |  116 ++++++++++++++++++++++++++++++++++++++++
 tests/generic/815.out |   15 +++++
 tests/generic/816     |  136 +++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/816.out |   19 +++++++
 tests/generic/group   |    6 ++
 13 files changed, 924 insertions(+)
 create mode 100755 tests/generic/811
 create mode 100644 tests/generic/811.out
 create mode 100755 tests/generic/812
 create mode 100644 tests/generic/812.out
 create mode 100755 tests/generic/813
 create mode 100644 tests/generic/813.out
 create mode 100755 tests/generic/814
 create mode 100644 tests/generic/814.out
 create mode 100755 tests/generic/815
 create mode 100644 tests/generic/815.out
 create mode 100755 tests/generic/816
 create mode 100644 tests/generic/816.out
tests/generic/811 new file +142 -0
new file mode 100755
index 0000000..7b09c05
@@ -0,0 +1,142 @@
+#! /bin/bash
+# FS QA Test No. 811
+#
+# Ensure that fallocate steps around reflinked ranges:
+#   - Reflink parts of two files together
+#   - Fallocate all the other sparse space.
+#   - Check that the reflinked areas are still there.
+#
+#-----------------------------------------------------------------------
+# 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 "falloc"
+_require_xfs_io_command "truncate"
+
+rm -f "$seqres.full"
+
+TESTDIR="$TEST_DIR/test-$seq"
+rm -rf "$TESTDIR"
+mkdir "$TESTDIR"
+
+echo "Create the original files"
+BLKSZ=65536
+_pwrite_byte 0x61 0 $((BLKSZ * 5 + 37)) "$TESTDIR/file1" >> "$seqres.full"
+
+_reflink_range "$TESTDIR/file1" $BLKSZ "$TESTDIR/file2" $BLKSZ \
+		$((BLKSZ * 4 + 37)) >> "$seqres.full"
+
+"$XFS_IO_PROG" -f -c "truncate $((BLKSZ * 5 + 37))" "$TESTDIR/file3" >> "$seqres.full"
+_reflink_range "$TESTDIR/file1" 0 "$TESTDIR/file3" 0 $BLKSZ >> "$seqres.full"
+
+"$XFS_IO_PROG" -f -c "truncate $((BLKSZ * 5 + 37))" "$TESTDIR/file4" >> "$seqres.full"
+_reflink_range "$TESTDIR/file1" $BLKSZ "$TESTDIR/file4" $BLKSZ $BLKSZ >> "$seqres.full"
+_reflink_range "$TESTDIR/file1" $((BLKSZ * 3)) "$TESTDIR/file4" $((BLKSZ * 3)) \
+		$BLKSZ >> "$seqres.full"
+
+_cp_reflink "$TESTDIR/file1" "$TESTDIR/file5"
+_test_remount
+
+echo "Compare sections"
+md5sum "$TESTDIR/file1" | _filter_test_dir
+md5sum "$TESTDIR/file2" | _filter_test_dir
+md5sum "$TESTDIR/file3" | _filter_test_dir
+md5sum "$TESTDIR/file4" | _filter_test_dir
+md5sum "$TESTDIR/file5" | _filter_test_dir
+
+_compare_range "$TESTDIR/file1" $BLKSZ "$TESTDIR/file2" $BLKSZ \
+		$((BLKSZ * 4 + 37)) \
+	|| echo "shared parts of files 1-2 changed"
+
+_compare_range "$TESTDIR/file1" 0 "$TESTDIR/file3" 0 $BLKSZ \
+	|| echo "shared parts of files 1-3 changed"
+
+_compare_range "$TESTDIR/file1" $BLKSZ "$TESTDIR/file4" $BLKSZ $BLKSZ \
+	|| echo "shared parts of files 1-4 changed"
+
+_compare_range "$TESTDIR/file1" 0 "$TESTDIR/file5" 0 $((BLKSZ * 5 + 37)) \
+	|| echo "shared parts of files 1-5 changed"
+
+echo "Compare files"
+C1="$(_md5_checksum "$TESTDIR/file1")"
+C2="$(_md5_checksum "$TESTDIR/file2")"
+C3="$(_md5_checksum "$TESTDIR/file3")"
+C4="$(_md5_checksum "$TESTDIR/file4")"
+C5="$(_md5_checksum "$TESTDIR/file5")"
+
+test "${C1}" != "${C2}" || echo "file1 and file2 should not match"
+test "${C1}" != "${C3}" || echo "file1 and file3 should not match"
+test "${C1}" != "${C4}" || echo "file1 and file4 should not match"
+test "${C1}"  = "${C5}" || echo "file1 and file5 should match"
+test "${C2}" != "${C3}" || echo "file2 and file3 should not match"
+test "${C2}" != "${C4}" || echo "file2 and file4 should not match"
+test "${C2}" != "${C5}" || echo "file2 and file5 should not match"
+test "${C3}" != "${C4}" || echo "file3 and file4 should not match"
+test "${C3}" != "${C5}" || echo "file3 and file5 should not match"
+test "${C4}" != "${C5}" || echo "file4 and file5 should not match"
+
+echo "falloc everything"
+"$XFS_IO_PROG" -f -c "falloc 0 $((BLKSZ * 5))" "$TESTDIR/file2" >> "$seqres.full"
+"$XFS_IO_PROG" -f -c "falloc 0 $((BLKSZ * 5))" "$TESTDIR/file3" >> "$seqres.full"
+"$XFS_IO_PROG" -f -c "falloc 0 $((BLKSZ * 5))" "$TESTDIR/file4" >> "$seqres.full"
+_test_remount
+
+echo "Compare files"
+md5sum "$TESTDIR/file1" | _filter_test_dir
+md5sum "$TESTDIR/file2" | _filter_test_dir
+md5sum "$TESTDIR/file3" | _filter_test_dir
+md5sum "$TESTDIR/file4" | _filter_test_dir
+md5sum "$TESTDIR/file5" | _filter_test_dir
+
+D1="$(_md5_checksum "$TESTDIR/file1")"
+D2="$(_md5_checksum "$TESTDIR/file2")"
+D3="$(_md5_checksum "$TESTDIR/file3")"
+D4="$(_md5_checksum "$TESTDIR/file4")"
+D5="$(_md5_checksum "$TESTDIR/file5")"
+
+test "${C1}" = "${D1}" || echo "file1 should not change"
+test "${C2}" = "${D2}" || echo "file2 should not change"
+test "${C3}" = "${D3}" || echo "file3 should not change"
+test "${C4}" = "${D4}" || echo "file4 should not change"
+test "${C5}" = "${D5}" || echo "file2 should not change"
+
+# success, all done
+status=0
+exit
tests/generic/811.out new file +16 -0
new file mode 100644
index 0000000..950613a
@@ -0,0 +1,16 @@
+QA output created by 811
+Create the original files
+Compare sections
+ee8004e6298fa128477bd4aa1adc69fb  TEST_DIR/test-811/file1
+a7cb8cb9697d59413e0d10495d226398  TEST_DIR/test-811/file2
+7d42a0a2865c94f45435a2ce7627da02  TEST_DIR/test-811/file3
+7f528bc76f4d61ff9cff7bc1906579c6  TEST_DIR/test-811/file4
+ee8004e6298fa128477bd4aa1adc69fb  TEST_DIR/test-811/file5
+Compare files
+falloc everything
+Compare files
+ee8004e6298fa128477bd4aa1adc69fb  TEST_DIR/test-811/file1
+a7cb8cb9697d59413e0d10495d226398  TEST_DIR/test-811/file2
+7d42a0a2865c94f45435a2ce7627da02  TEST_DIR/test-811/file3
+7f528bc76f4d61ff9cff7bc1906579c6  TEST_DIR/test-811/file4
+ee8004e6298fa128477bd4aa1adc69fb  TEST_DIR/test-811/file5
tests/generic/812 new file +142 -0

142 lines not on this page · raw message

tests/generic/812.out new file +19 -0
new file mode 100644
index 0000000..16dc3df
@@ -0,0 +1,19 @@
+QA output created by 812
+Create the original files
+564b34fb4a562f6d864f371248e48540  TEST_DIR/test-812/file1
+564b34fb4a562f6d864f371248e48540  TEST_DIR/test-812/file2
+564b34fb4a562f6d864f371248e48540  TEST_DIR/test-812/file3
+564b34fb4a562f6d864f371248e48540  TEST_DIR/test-812/file4
+9a239246ce4bee20f2de1b0ba41a41e0  TEST_DIR/test-812/file2.chk
+859c251680d8bbf0f859f5c6d7a6a2a2  TEST_DIR/test-812/file3.chk
+c931e8500c1a56a5b7369f7f1b971690  TEST_DIR/test-812/file4.chk
+fcollapse files
+Compare files
+564b34fb4a562f6d864f371248e48540  TEST_DIR/test-812/file1
+9a239246ce4bee20f2de1b0ba41a41e0  TEST_DIR/test-812/file2
+859c251680d8bbf0f859f5c6d7a6a2a2  TEST_DIR/test-812/file3
+c931e8500c1a56a5b7369f7f1b971690  TEST_DIR/test-812/file4
+9a239246ce4bee20f2de1b0ba41a41e0  TEST_DIR/test-812/file2.chk
+859c251680d8bbf0f859f5c6d7a6a2a2  TEST_DIR/test-812/file3.chk
+c931e8500c1a56a5b7369f7f1b971690  TEST_DIR/test-812/file4.chk
+Compare against check files
tests/generic/813 new file +136 -0

136 lines not on this page · raw message

tests/generic/813.out new file +19 -0
new file mode 100644
index 0000000..98fda42
@@ -0,0 +1,19 @@
+QA output created by 813
+Create the original files
+856bb58abaf1ac79aa1aa45b7de7218b  TEST_DIR/test-813/file1
+856bb58abaf1ac79aa1aa45b7de7218b  TEST_DIR/test-813/file2
+856bb58abaf1ac79aa1aa45b7de7218b  TEST_DIR/test-813/file3
+856bb58abaf1ac79aa1aa45b7de7218b  TEST_DIR/test-813/file4
+e263fae701bc40c23a3edb20aad5573e  TEST_DIR/test-813/file2.chk
+91722d7c8baf83f300a8dc35f1ffcce2  TEST_DIR/test-813/file3.chk
+c931e8500c1a56a5b7369f7f1b971690  TEST_DIR/test-813/file4.chk
+fpunch files
+Compare files
+856bb58abaf1ac79aa1aa45b7de7218b  TEST_DIR/test-813/file1
+e263fae701bc40c23a3edb20aad5573e  TEST_DIR/test-813/file2
+91722d7c8baf83f300a8dc35f1ffcce2  TEST_DIR/test-813/file3
+c931e8500c1a56a5b7369f7f1b971690  TEST_DIR/test-813/file4
+e263fae701bc40c23a3edb20aad5573e  TEST_DIR/test-813/file2.chk
+91722d7c8baf83f300a8dc35f1ffcce2  TEST_DIR/test-813/file3.chk
+c931e8500c1a56a5b7369f7f1b971690  TEST_DIR/test-813/file4.chk
+Compare against check files
tests/generic/814 new file +139 -0

139 lines not on this page · raw message

tests/generic/814.out new file +19 -0
new file mode 100644
index 0000000..6093561
@@ -0,0 +1,19 @@
+QA output created by 814
+Create the original files
+856bb58abaf1ac79aa1aa45b7de7218b  TEST_DIR/test-814/file1
+856bb58abaf1ac79aa1aa45b7de7218b  TEST_DIR/test-814/file2
+856bb58abaf1ac79aa1aa45b7de7218b  TEST_DIR/test-814/file3
+856bb58abaf1ac79aa1aa45b7de7218b  TEST_DIR/test-814/file4
+2b0921503c9f661b7690ac5b42f01f97  TEST_DIR/test-814/file2.chk
+c424badbaad621c331a8ef213b78ac2a  TEST_DIR/test-814/file3.chk
+33b4940294a1d94bee813907d6105ff7  TEST_DIR/test-814/file4.chk
+finsert files
+Compare files
+856bb58abaf1ac79aa1aa45b7de7218b  TEST_DIR/test-814/file1
+2b0921503c9f661b7690ac5b42f01f97  TEST_DIR/test-814/file2
+c424badbaad621c331a8ef213b78ac2a  TEST_DIR/test-814/file3
+33b4940294a1d94bee813907d6105ff7  TEST_DIR/test-814/file4
+2b0921503c9f661b7690ac5b42f01f97  TEST_DIR/test-814/file2.chk
+c424badbaad621c331a8ef213b78ac2a  TEST_DIR/test-814/file3.chk
+33b4940294a1d94bee813907d6105ff7  TEST_DIR/test-814/file4.chk
+Compare against check files
tests/generic/815 new file +116 -0

116 lines not on this page · raw message

tests/generic/815.out new file +15 -0
new file mode 100644
index 0000000..8c36c2d
@@ -0,0 +1,15 @@
+QA output created by 815
+Create the original files
+f924bdda449af63913cad4357e39301e  TEST_DIR/test-815/file1
+f924bdda449af63913cad4357e39301e  TEST_DIR/test-815/file2
+f924bdda449af63913cad4357e39301e  TEST_DIR/test-815/file3
+16cb529abe447a9f203a3d5eb3433c8b  TEST_DIR/test-815/file2.chk
+6f042ad39f6c74f4b73936db89baa2e2  TEST_DIR/test-815/file3.chk
+truncate files
+Compare files
+f924bdda449af63913cad4357e39301e  TEST_DIR/test-815/file1
+16cb529abe447a9f203a3d5eb3433c8b  TEST_DIR/test-815/file2
+6f042ad39f6c74f4b73936db89baa2e2  TEST_DIR/test-815/file3
+16cb529abe447a9f203a3d5eb3433c8b  TEST_DIR/test-815/file2.chk
+6f042ad39f6c74f4b73936db89baa2e2  TEST_DIR/test-815/file3.chk
+Compare against check files
tests/generic/816 new file +136 -0

136 lines not on this page · raw message

tests/generic/816.out new file +19 -0
new file mode 100644
index 0000000..f3e1396
@@ -0,0 +1,19 @@
+QA output created by 816
+Create the original files
+856bb58abaf1ac79aa1aa45b7de7218b  TEST_DIR/test-816/file1
+856bb58abaf1ac79aa1aa45b7de7218b  TEST_DIR/test-816/file2
+856bb58abaf1ac79aa1aa45b7de7218b  TEST_DIR/test-816/file3
+856bb58abaf1ac79aa1aa45b7de7218b  TEST_DIR/test-816/file4
+e263fae701bc40c23a3edb20aad5573e  TEST_DIR/test-816/file2.chk
+91722d7c8baf83f300a8dc35f1ffcce2  TEST_DIR/test-816/file3.chk
+c931e8500c1a56a5b7369f7f1b971690  TEST_DIR/test-816/file4.chk
+fzero files
+Compare files
+856bb58abaf1ac79aa1aa45b7de7218b  TEST_DIR/test-816/file1
+e263fae701bc40c23a3edb20aad5573e  TEST_DIR/test-816/file2
+91722d7c8baf83f300a8dc35f1ffcce2  TEST_DIR/test-816/file3
+c931e8500c1a56a5b7369f7f1b971690  TEST_DIR/test-816/file4
+e263fae701bc40c23a3edb20aad5573e  TEST_DIR/test-816/file2.chk
+91722d7c8baf83f300a8dc35f1ffcce2  TEST_DIR/test-816/file3.chk
+c931e8500c1a56a5b7369f7f1b971690  TEST_DIR/test-816/file4.chk
+Compare against check files
tests/generic/group +6 -0
index a72d416..58c68c8 100644
@@ -219,6 +219,12 @@
 808 auto quick clone
 809 auto quick clone
 810 auto quick clone
+811 auto quick clone
+812 auto quick clone
+813 auto quick clone
+814 auto quick clone
+815 auto quick clone
+816 auto quick clone
 817 auto quick clone
 818 auto quick clone
 819 auto quick clone

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#6 lore raw

PATCH 6/11 reflink: concurrent operations tests

In reply to Darrick J. Wong

Make sure that running reflink ops while other IO is ongoing doesn't break the filesystem.

---
 tests/generic/821     |   97 +++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/821.out |    6 +++
 tests/generic/822     |   97 +++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/822.out |    6 +++
 tests/generic/823     |   93 +++++++++++++++++++++++++++++++++++++++++++
 tests/generic/823.out |    6 +++
 tests/generic/824     |   93 +++++++++++++++++++++++++++++++++++++++++++
 tests/generic/824.out |    6 +++
 tests/generic/825     |  105 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/825.out |    7 +++
 tests/generic/826     |  105 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/826.out |    7 +++
 tests/generic/827     |   95 ++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/827.out |    7 +++
 tests/generic/828     |   95 ++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/828.out |    7 +++
 tests/generic/829     |   79 +++++++++++++++++++++++++++++++++++++
 tests/generic/829.out |    6 +++
 tests/generic/group   |    9 ++++
 19 files changed, 926 insertions(+)
 create mode 100755 tests/generic/821
 create mode 100644 tests/generic/821.out
 create mode 100755 tests/generic/822
 create mode 100644 tests/generic/822.out
 create mode 100755 tests/generic/823
 create mode 100644 tests/generic/823.out
 create mode 100755 tests/generic/824
 create mode 100644 tests/generic/824.out
 create mode 100755 tests/generic/825
 create mode 100644 tests/generic/825.out
 create mode 100755 tests/generic/826
 create mode 100644 tests/generic/826.out
 create mode 100755 tests/generic/827
 create mode 100644 tests/generic/827.out
 create mode 100755 tests/generic/828
 create mode 100644 tests/generic/828.out
 create mode 100755 tests/generic/829
 create mode 100644 tests/generic/829.out
tests/generic/821 new file +97 -0
new file mode 100755
index 0000000..d38eff7
@@ -0,0 +1,97 @@
+#! /bin/bash
+# FS QA Test No. 821
+#
+# Test for races or FS corruption when DIO writing to a file that's also
+# the target of a reflink operation.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2015 Oracle, 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 7 15
+
+_cleanup()
+{
+    cd /
+    rm -rf "$tmp".*
+    wait
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/reflink
+
+# real QA test starts here
+_supported_os Linux
+_require_scratch_reflink
+
+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"
+
+loops=1024
+nr_loops=$((loops - 1))
+BLKSZ=65536
+
+echo "Initialize files"
+echo > "$seqres.full"
+_pwrite_byte 0x61 0 $((loops * BLKSZ)) "$TESTDIR/file1" >> "$seqres.full"
+_pwrite_byte 0x62 0 $((loops * BLKSZ)) "$TESTDIR/file2" >> "$seqres.full"
+_scratch_remount
+
+# Direct I/O overwriter...
+overwrite() {
+	while [ ! -e "$TESTDIR/finished" ]; do
+		seq $nr_loops -1 0 | while read i; do
+			_pwrite_byte 0x63 $((i * BLKSZ)) $BLKSZ -d "$TESTDIR/file2" >> "$seqres.full"
+		done
+	done
+}
+
+echo "Reflink and dio write the target"
+overwrite &
+seq 1 10 | while read j; do
+	seq 0 $nr_loops | while read i; do
+		_reflink_range  "$TESTDIR/file1" $((i * BLKSZ)) \
+				"$TESTDIR/file2" $((i * BLKSZ)) $BLKSZ >> "$seqres.full"
+		[ $? -ne 0 ] && exit
+	done
+done
+touch "$TESTDIR/finished"
+wait
+
+echo "Check for damage"
+umount "$SCRATCH_MNT"
+_check_scratch_fs
+
+echo "Done"
+
+# success, all done
+status=0
+exit
tests/generic/821.out new file +6 -0
new file mode 100644
index 0000000..ca6bc53
@@ -0,0 +1,6 @@
+QA output created by 821
+Format and mount
+Initialize files
+Reflink and dio write the target
+Check for damage
+Done
tests/generic/822 new file +97 -0

97 lines not on this page · raw message

tests/generic/822.out new file +6 -0
new file mode 100644
index 0000000..14399ae
@@ -0,0 +1,6 @@
+QA output created by 822
+Format and mount
+Initialize files
+Reflink and write the target
+Check for damage
+Done
tests/generic/823 new file +93 -0

93 lines not on this page · raw message

tests/generic/823.out new file +6 -0
new file mode 100644
index 0000000..ef3e209
@@ -0,0 +1,6 @@
+QA output created by 823
+Format and mount
+Initialize file
+Snapshot a file undergoing buffered rewrite
+Check for damage
+Done
tests/generic/824 new file +93 -0

93 lines not on this page · raw message

tests/generic/824.out new file +6 -0
new file mode 100644
index 0000000..0376736
@@ -0,0 +1,6 @@
+QA output created by 824
+Format and mount
+Initialize file
+Snapshot a file undergoing directio rewrite
+Check for damage
+Done
tests/generic/825 new file +105 -0

105 lines not on this page · raw message

tests/generic/825.out new file +7 -0
new file mode 100644
index 0000000..1e2f36c
@@ -0,0 +1,7 @@
+QA output created by 825
+Format and mount
+Initialize files
+Reflink and dio reread the files!
+Finished reflinking
+Check fs
+Done
tests/generic/826 new file +105 -0

105 lines not on this page · raw message

tests/generic/826.out new file +7 -0
new file mode 100644
index 0000000..144f4bc
@@ -0,0 +1,7 @@
+QA output created by 826
+Format and mount
+Initialize files
+Reflink and reread the files!
+Finished reflinking
+Check fs
+Done
tests/generic/827 new file +95 -0

95 lines not on this page · raw message

tests/generic/827.out new file +7 -0
new file mode 100644
index 0000000..1b05f59
@@ -0,0 +1,7 @@
+QA output created by 827
+Format and mount
+Initialize files
+Dedupe and rewrite the file!
+Finished dedupeing
+Check fs
+Done
tests/generic/828 new file +95 -0

95 lines not on this page · raw message

tests/generic/828.out new file +7 -0
new file mode 100644
index 0000000..fb31777
@@ -0,0 +1,7 @@
+QA output created by 828
+Format and mount
+Initialize files
+Dedupe and rewrite the file!
+Finished dedupeing
+Check fs
+Done
tests/generic/829 new file +79 -0

79 lines not on this page · raw message

tests/generic/829.out new file +6 -0
new file mode 100644
index 0000000..9cee8ba
@@ -0,0 +1,6 @@
+QA output created by 829
+Format and mount
+Initialize files
+Delete while rewriting
+Check fs
+Done
tests/generic/group +9 -0
index 58c68c8..0c137ea 100644
@@ -228,5 +228,14 @@
 817 auto quick clone
 818 auto quick clone
 819 auto quick clone
+821 auto quick clone
+822 auto quick clone
+823 auto quick clone
+824 auto quick clone
+825 auto quick clone
+826 auto quick clone
+827 auto quick clone
+828 auto quick clone
+829 auto quick clone
 837 auto quick clone
 838 auto quick clone

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#7 lore raw

PATCH 7/11 reflink: test accuracy of free block counts

In reply to Darrick J. Wong

Check that the free block counts seem to be handled correctly in the reflink operation and subsequent attempts to rewrite reflinked copies.

---
 tests/generic/830     |   78 ++++++++++++++++++++++++++++++
 tests/generic/830.out |    4 ++
 tests/generic/831     |   98 +++++++++++++++++++++++++++++++++++++
 tests/generic/831.out |    8 +++
 tests/generic/832     |  103 +++++++++++++++++++++++++++++++++++++++
 tests/generic/832.out |    8 +++
 tests/generic/833     |  102 +++++++++++++++++++++++++++++++++++++++
 tests/generic/833.out |    8 +++
 tests/generic/834     |  110 ++++++++++++++++++++++++++++++++++++++++++
 tests/generic/834.out |   11 ++++
 tests/generic/835     |  114 +++++++++++++++++++++++++++++++++++++++++++
 tests/generic/835.out |   11 ++++
 tests/generic/836     |  129 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/836.out |   32 ++++++++++++
 tests/generic/group   |    7 +++
 15 files changed, 823 insertions(+)
 create mode 100755 tests/generic/830
 create mode 100644 tests/generic/830.out
 create mode 100755 tests/generic/831
 create mode 100644 tests/generic/831.out
 create mode 100755 tests/generic/832
 create mode 100644 tests/generic/832.out
 create mode 100755 tests/generic/833
 create mode 100644 tests/generic/833.out
 create mode 100755 tests/generic/834
 create mode 100644 tests/generic/834.out
 create mode 100755 tests/generic/835
 create mode 100644 tests/generic/835.out
 create mode 100755 tests/generic/836
 create mode 100644 tests/generic/836.out
tests/generic/830 new file +78 -0
new file mode 100755
index 0000000..d85bacf
@@ -0,0 +1,78 @@
+#! /bin/bash
+# FS QA Test No. 830
+#
+# Ensure that reflinking a file N times doesn't eat a lot of blocks
+#   - Create a file and record fs block usage
+#   - Create some reflink copies
+#   - Compare fs block usage to before
+#
+#-----------------------------------------------------------------------
+# 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
+
+rm -f "$seqres.full"
+
+TESTDIR="$TEST_DIR/test-$seq"
+rm -rf "$TESTDIR"
+mkdir "$TESTDIR"
+
+echo "Create the original file blocks"
+BLKSZ="$(stat -f $TESTDIR -c '%S')"
+BLKS=2000
+MARGIN=100
+SZ=$((BLKSZ * BLKS))
+NR=7
+_pwrite_byte 0x61 0 $SZ "$TESTDIR/file1" >> "$seqres.full"
+sync
+FREE_BLOCKS0=$(stat -f "$TESTDIR" -c '%f')
+
+echo "Create the reflink copies"
+for i in `seq 2 $NR`; do
+	_cp_reflink "$TESTDIR/file1" "$TESTDIR/file.$i"
+done
+_test_remount
+FREE_BLOCKS1=$(stat -f "$TESTDIR" -c '%f')
+
+_within_tolerance "free blocks after reflink" $FREE_BLOCKS1 $FREE_BLOCKS0 $MARGIN -v
+
+# success, all done
+status=0
+exit
tests/generic/830.out new file +4 -0
new file mode 100644
index 0000000..76e2f1d
@@ -0,0 +1,4 @@
+QA output created by 830
+Create the original file blocks
+Create the reflink copies
+free blocks after reflink is in range
tests/generic/831 new file +98 -0

98 lines not on this page · raw message

tests/generic/831.out new file +8 -0
new file mode 100644
index 0000000..88e0a23
@@ -0,0 +1,8 @@
+QA output created by 831
+Create the original file blocks
+Create the reflink copies
+Delete most of the files
+Delete all the files
+free blocks after reflink is in range
+free blocks after deleting some reflink copies is in range
+free blocks after deleting all copies is in range
tests/generic/832 new file +103 -0

103 lines not on this page · raw message

tests/generic/832.out new file +8 -0
new file mode 100644
index 0000000..bb95578
@@ -0,0 +1,8 @@
+QA output created by 832
+Create the original file blocks
+Create the reflink copies
+Punch most of the blocks
+Punch all the files
+free blocks after reflink is in range
+free blocks after punching some reflink copies is in range
+free blocks after punching all copies is in range
tests/generic/833 new file +102 -0

102 lines not on this page · raw message

tests/generic/833.out new file +8 -0
new file mode 100644
index 0000000..a9a2941
@@ -0,0 +1,8 @@
+QA output created by 833
+Create the original file blocks
+Create the reflink copies
+Collapse most of the blocks
+Collpase nearly all the files
+free blocks after reflink is in range
+free blocks after fcollapsing some reflink copies is in range
+free blocks after fcollapsing all copies is in range
tests/generic/834 new file +110 -0

110 lines not on this page · raw message

tests/generic/834.out new file +11 -0
new file mode 100644
index 0000000..e67e803
@@ -0,0 +1,11 @@
+QA output created by 834
+Create the original file blocks
+Create the reflink copies
+Rewrite some of the blocks
+Rewrite all the files
+Rewrite the original file
+free blocks after reflinking is in range
+free blocks after partially CoWing some copies is in range
+free blocks after CoWing all copies is in range
+free blocks after overwriting original is in range
+free blocks after all tests is in range
tests/generic/835 new file +114 -0

114 lines not on this page · raw message

tests/generic/835.out new file +11 -0
new file mode 100644
index 0000000..c1103be
@@ -0,0 +1,11 @@
+QA output created by 835
+Create the original file blocks
+Create the reflink copies
+Rewrite some of the blocks
+Rewrite all the files
+Rewrite the original file
+free blocks after reflinking is in range
+free blocks after partially CoWing some copies is in range
+free blocks after CoWing all copies is in range
+free blocks after overwriting original is in range
+free blocks after all tests is in range
tests/generic/836 new file +129 -0

129 lines not on this page · raw message

tests/generic/836.out new file +32 -0
new file mode 100644
index 0000000..45f7750
@@ -0,0 +1,32 @@
+QA output created by 836
+Create the original file blocks
+Create the reflink copies
+TEST_DIR/test-836/file1          ---
+TEST_DIR/test-836/file2          ---
+TEST_DIR/test-836/file3          ---
+TEST_DIR/test-836/file4          ---
+funshare part of a file
+TEST_DIR/test-836/file1          ---
+TEST_DIR/test-836/file2          ---
+TEST_DIR/test-836/file3          ---
+TEST_DIR/test-836/file4          ---
+funshare some of the copies
+TEST_DIR/test-836/file1          ---
+TEST_DIR/test-836/file2          No_COW
+TEST_DIR/test-836/file3          No_COW
+TEST_DIR/test-836/file4          ---
+funshare the rest of the files
+TEST_DIR/test-836/file1          No_COW
+TEST_DIR/test-836/file2          No_COW
+TEST_DIR/test-836/file3          No_COW
+TEST_DIR/test-836/file4          No_COW
+Rewrite the original file
+TEST_DIR/test-836/file1          No_COW
+TEST_DIR/test-836/file2          No_COW
+TEST_DIR/test-836/file3          No_COW
+TEST_DIR/test-836/file4          No_COW
+free blocks after reflinking is in range
+free blocks after nocow'ing some copies is in range
+free blocks after nocow'ing all copies is in range
+free blocks after overwriting original is in range
+free blocks after all tests is in range
tests/generic/group +7 -0
index 0c137ea..9b57872 100644
@@ -237,5 +237,12 @@
 827 auto quick clone
 828 auto quick clone
 829 auto quick clone
+830 auto quick clone
+831 auto quick clone
+832 auto quick clone
+833 auto quick clone
+834 auto quick clone
+835 auto quick clone
+836 auto quick clone
 837 auto quick clone
 838 auto quick clone

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#8 lore raw

PATCH 8/11 reflink: test error conditions due to bad inputs

In reply to Darrick J. Wong

Check that we can feed bad inputs to reflink and it'll reject them.

---
 tests/generic/839     |  106 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/839.out |   19 +++++++++
 tests/generic/846     |  106 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/846.out |   19 +++++++++
 tests/generic/group   |    2 +
 5 files changed, 252 insertions(+)
 create mode 100755 tests/generic/839
 create mode 100644 tests/generic/839.out
 create mode 100755 tests/generic/846
 create mode 100644 tests/generic/846.out
tests/generic/839 new file +106 -0
new file mode 100755
index 0000000..0b754b1
@@ -0,0 +1,106 @@
+#! /bin/bash
+# FS QA Test No. 839
+#
+# Check that various invalid reflink scenarios are rejected
+#
+#-----------------------------------------------------------------------
+# 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".* "$TESTDIR1"
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/attr
+. ./common/reflink
+
+# real QA test starts here
+_supported_os Linux
+_require_test_reflink
+_require_scratch_reflink
+
+rm -f "$seqres.full"
+
+echo "Format and mount"
+_scratch_mkfs > "$seqres.full" 2>&1
+_scratch_mount >> "$seqres.full" 2>&1
+
+TESTDIR1="$TEST_DIR/test-$seq"
+rm -rf "$TESTDIR1"
+mkdir "$TESTDIR1"
+
+TESTDIR2=$SCRATCH_MNT/test-$seq
+rm -rf "$TESTDIR2"
+mkdir "$TESTDIR2"
+
+echo "Create the original files"
+BLKSZ="$(stat -f $TESTDIR1 -c '%S')"
+BLKS=1000
+MARGIN=50
+SZ=$((BLKSZ * BLKS))
+FREE_BLOCKS0=$(stat -f $TESTDIR1 -c '%f')
+NR=4
+_pwrite_byte 0x61 0 $SZ "$TESTDIR1/file1" >> "$seqres.full"
+_pwrite_byte 0x61 0 $SZ "$TESTDIR1/file2" >> "$seqres.full"
+_pwrite_byte 0x61 0 $SZ "$TESTDIR2/file1" >> "$seqres.full"
+_pwrite_byte 0x61 0 $SZ "$TESTDIR2/file2" >> "$seqres.full"
+sync
+
+echo "Try cross-device reflink"
+_reflink_range "$TESTDIR1/file1" 0 "$TESTDIR2/file1" 0 $BLKSZ
+
+echo "Try unaligned reflink"
+_reflink_range "$TESTDIR1/file1" 37 "$TESTDIR1/file1" 59 23
+
+echo "Try overlapping reflink"
+_reflink_range "$TESTDIR1/file1" 0 "$TESTDIR1/file1" 1 $((BLKSZ * 2))
+
+echo "Try reflink past EOF"
+_reflink_range "$TESTDIR1/file1" $(( (BLKS + 10) * BLKSZ)) "$TESTDIR1/file1" 0 $BLKSZ
+
+chattr +i $TESTDIR1/file1 $TESTDIR1/file2
+echo "Try reflink on immutable files"
+_reflink_range "$TESTDIR1/file1" 0 "$TESTDIR1/file2" 0 $BLKSZ 2>&1 | _filter_test_dir
+chattr -i $TESTDIR1/file1 $TESTDIR1/file2
+
+echo "Reflink two files"
+_reflink_range "$TESTDIR1/file1" 0 "$TESTDIR1/file2" 0 $BLKSZ >> "$seqres.full"
+_reflink_range "$TESTDIR2/file1" 0 "$TESTDIR2/file2" 0 $BLKSZ >> "$seqres.full"
+
+lsattr -l $TESTDIR1/ | _filter_test_dir
+lsattr -l $TESTDIR2/ | _filter_scratch
+
+echo "Check scratch fs"
+umount $SCRATCH_MNT
+_check_scratch_fs
+
+# success, all done
+status=0
+exit
tests/generic/839.out new file +19 -0
new file mode 100644
index 0000000..d8703b1
@@ -0,0 +1,19 @@
+QA output created by 839
+Format and mount
+Create the original files
+Try cross-device reflink
+XFS_IOC_CLONE_RANGE: Invalid cross-device link
+Try unaligned reflink
+XFS_IOC_CLONE_RANGE: Invalid argument
+Try overlapping reflink
+XFS_IOC_CLONE_RANGE: Invalid argument
+Try reflink past EOF
+XFS_IOC_CLONE_RANGE: Invalid argument
+Try reflink on immutable files
+TEST_DIR/test-839/file2: Permission denied
+Reflink two files
+TEST_DIR/test-839/file1          ---
+TEST_DIR/test-839/file2          ---
+SCRATCH_MNT/test-839/file1          ---
+SCRATCH_MNT/test-839/file2          ---
+Check scratch fs
tests/generic/846 new file +106 -0

106 lines not on this page · raw message

tests/generic/846.out new file +19 -0
new file mode 100644
index 0000000..65a20bf
@@ -0,0 +1,19 @@
+QA output created by 846
+Format and mount
+Create the original files
+Try cross-device dedupe
+dedupe: Invalid cross-device link
+Try unaligned dedupe
+dedupe: Invalid argument
+Try overlapping dedupe
+dedupe: Invalid argument
+Try dedupe past EOF
+dedupe: Invalid argument
+Try dedupe on immutable files
+TEST_DIR/test-846/file2: Permission denied
+Dedupe two files
+TEST_DIR/test-846/file1          ---
+TEST_DIR/test-846/file2          ---
+SCRATCH_MNT/test-846/file1          ---
+SCRATCH_MNT/test-846/file2          ---
+Check scratch fs
tests/generic/group +2 -0
index 9b57872..90f28aa 100644
@@ -246,3 +246,5 @@
 836 auto quick clone
 837 auto quick clone
 838 auto quick clone
+839 auto quick clone
+846 auto quick clone

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#9 lore raw

PATCH 9/11 xfs: test xfs-specific reflink pieces

In reply to Darrick J. Wong

Check that growfs and xfs_fsr still work properly on reflinked fses.

---
 tests/xfs/800     |   79 ++++++++++++++++++++++++++++
 tests/xfs/800.out |    6 ++
 tests/xfs/801     |  148 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/xfs/801.out |   27 ++++++++++
 tests/xfs/802     |   87 +++++++++++++++++++++++++++++++
 tests/xfs/802.out |    6 ++
 tests/xfs/803     |  109 +++++++++++++++++++++++++++++++++++++++
 tests/xfs/803.out |   13 +++++
 tests/xfs/804     |   77 ++++++++++++++++++++++++++++
 tests/xfs/804.out |    0 
 tests/xfs/group   |    5 ++
 11 files changed, 557 insertions(+)
 create mode 100755 tests/xfs/800
 create mode 100644 tests/xfs/800.out
 create mode 100755 tests/xfs/801
 create mode 100644 tests/xfs/801.out
 create mode 100755 tests/xfs/802
 create mode 100644 tests/xfs/802.out
 create mode 100755 tests/xfs/803
 create mode 100644 tests/xfs/803.out
 create mode 100755 tests/xfs/804
 create mode 100644 tests/xfs/804.out
tests/xfs/800 new file +79 -0
new file mode 100755
index 0000000..d9fe5b4
@@ -0,0 +1,79 @@
+#! /bin/bash
+# FS QA Test No. 800
+#
+# Tests xfs_growfs on a reflinked filesystem
+#
+#-----------------------------------------------------------------------
+# 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 -f "$tmp".*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/reflink
+
+# real QA test starts here
+_supported_os Linux
+_supported_fs xfs
+_require_scratch_reflink
+_require_cp_reflink
+
+echo "Format and mount"
+_scratch_mkfs -d size=$((2 * 4096 * 4096)) -l size=4194304 > "$seqres.full" 2>&1
+_scratch_mount >> "$seqres.full" 2>&1
+
+TESTDIR="$SCRATCH_MNT/test-$seq"
+rm -rf "$TESTDIR"
+mkdir "$TESTDIR"
+
+echo "Create the original file and reflink to copy1, copy2"
+BLKSZ="$(stat -f "$TESTDIR" -c '%S')"
+_pwrite_byte 0x61 0 $((BLKSZ * 14 + 71)) "$TESTDIR/original" >> "$seqres.full"
+_cp_reflink "$TESTDIR/original" "$TESTDIR/copy1"
+_cp_reflink "$TESTDIR/copy1" "$TESTDIR/copy2"
+
+echo "Grow fs"
+"$XFS_GROWFS_PROG" "$SCRATCH_MNT" 2>&1 |  _filter_growfs >> "$seqres.full"
+_scratch_remount
+
+echo "Create more reflink copies"
+_cp_reflink "$TESTDIR/original" "$TESTDIR/copy3"
+
+xfs_info "$SCRATCH_MNT" >> "$seqres.full"
+
+echo "Check scratch fs"
+umount "$SCRATCH_MNT"
+_check_scratch_fs
+
+# success, all done
+status=0
+exit
tests/xfs/800.out new file +6 -0
new file mode 100644
index 0000000..73d4f71
@@ -0,0 +1,6 @@
+QA output created by 800
+Format and mount
+Create the original file and reflink to copy1, copy2
+Grow fs
+Create more reflink copies
+Check scratch fs
tests/xfs/801 new file +148 -0

148 lines not on this page · raw message

tests/xfs/801.out new file +27 -0
new file mode 100644
index 0000000..4733f18
@@ -0,0 +1,27 @@
+QA output created by 801
+Format and mount
+Create the original file and reflink to file2, file3
+b81534f439aac5c34ce3ed60a03eba70  SCRATCH_MNT/test-801/file1
+b81534f439aac5c34ce3ed60a03eba70  SCRATCH_MNT/test-801/file2
+b81534f439aac5c34ce3ed60a03eba70  SCRATCH_MNT/test-801/file3
+b81534f439aac5c34ce3ed60a03eba70  SCRATCH_MNT/test-801/file4
+CoW the reflink copies
+b81534f439aac5c34ce3ed60a03eba70  SCRATCH_MNT/test-801/file1
+c650f1cf6c9f07b22e3e21ec7d49ded5  SCRATCH_MNT/test-801/file2
+56ed2f712c91e035adeeb26ed105a982  SCRATCH_MNT/test-801/file3
+b81534f439aac5c34ce3ed60a03eba70  SCRATCH_MNT/test-801/file4
+Defragment
+SCRATCH_MNT/test-801/file1          ---
+SCRATCH_MNT/test-801/file2          ---
+SCRATCH_MNT/test-801/file3          ---
+SCRATCH_MNT/test-801/file4          ---
+b81534f439aac5c34ce3ed60a03eba70  SCRATCH_MNT/test-801/file1
+c650f1cf6c9f07b22e3e21ec7d49ded5  SCRATCH_MNT/test-801/file2
+56ed2f712c91e035adeeb26ed105a982  SCRATCH_MNT/test-801/file3
+b81534f439aac5c34ce3ed60a03eba70  SCRATCH_MNT/test-801/file4
+Check files
+free blocks after creating some reflink copies is in range
+free blocks after CoW some reflink copies is in range
+free blocks after defragging all reflink copies is in range
+free blocks after all tests is in range
+Check scratch fs
tests/xfs/802 new file +87 -0

87 lines not on this page · raw message

tests/xfs/802.out new file +6 -0
new file mode 100644
index 0000000..ad2ef03
@@ -0,0 +1,6 @@
+QA output created by 802
+Create the original file blocks
+Reflink every other block
+Create metadump file
+Restore metadump
+Check restored fs
tests/xfs/803 new file +109 -0

109 lines not on this page · raw message

tests/xfs/803.out new file +13 -0
new file mode 100644
index 0000000..582682d
@@ -0,0 +1,13 @@
+QA output created by 803
++ create scratch fs
++ mount fs image
++ make some files
++ check fs
++ corrupt image
++ mount image
++ reflink more
++ repair fs
++ mount image (2)
++ chattr -R -i
++ reflink more (2)
++ check fs (2)
tests/xfs/804 new file +77 -0

77 lines not on this page · raw message

tests/xfs/804.out new file +0 -0
new file mode 100644
index 0000000..e69de29
tests/xfs/group +5 -0
index 8261f86..eccfb73 100644
@@ -220,3 +220,8 @@
 303 auto quick quota
 304 auto quick quota
 305 auto quota
+800 auto quick clone
+801 auto quick clone
+802 auto quick clone
+803 fuzzers
+804 auto quick clone

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#10 lore raw

PATCH 10/11 reflink: test what happens when we hit resource limits

In reply to Darrick J. Wong

Add a few horrible opt-in stress tests to see what happens if we try to reflink the same block billions of times, and what happens if we run out of space while reflinking a file.

---
 tests/generic/840     |   99 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/840.out |    0 
 tests/generic/841     |   81 ++++++++++++++++++++++++++++++++++++++++
 tests/generic/841.out |    5 ++
 tests/generic/group   |    2 +
 5 files changed, 187 insertions(+)
 create mode 100755 tests/generic/840
 create mode 100644 tests/generic/840.out
 create mode 100755 tests/generic/841
 create mode 100644 tests/generic/841.out
tests/generic/840 new file +99 -0
new file mode 100755
index 0000000..137cc3d
@@ -0,0 +1,99 @@
+#! /bin/bash
+# FS QA Test No. 840
+#
+# Try to hit the maximum reference count (eek!)
+#
+# This test runs extremely slowly, so it's not automatically run anywhere.
+#
+#-----------------------------------------------------------------------
+# 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".* "$TESTDIR1"
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/attr
+. ./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"
+
+# Well let's hope the maximum reflink count is (less than (ha!)) 2^32...
+
+echo "Create a one block file"
+BLKSZ="$(stat -f "$TESTDIR" -c '%S')"
+_pwrite_byte 0x61 0 $BLKSZ "$TESTDIR/file1" >> "$seqres.full"
+_pwrite_byte 0x62 0 $BLKSZ "$TESTDIR/file2" >> "$seqres.full"
+_cp_reflink "$TESTDIR/file1" "$TESTDIR/file2" >> "$seqres.full"
+
+nr=32
+fnr=32
+for i in $(seq 0 $fnr); do
+	echo " ++ Reflink size $i, $(( (2 ** i) * BLKSZ)) bytes" | tee -a "$seqres.full"
+	n=$(( (2 ** i) * BLKSZ))
+	_reflink_range "$TESTDIR/file1" 0 "$TESTDIR/file1" $n $n >> "$seqres.full" || break
+done
+
+nrf=$((nr - fnr))
+echo "Clone $((2 ** nrf)) files"
+seq 0 $((2 ** nrf)) | while read i; do
+	_cp-reflink "$TESTDIR/file1" "$TESTDIR/file1-$i"
+done
+
+echo "Check scratch fs"
+umount "$SCRATCH_MNT"
+_check_scratch_fs
+
+echo "Remove big file and recheck"
+_scratch_mount >> "$seqres.full" 2>&1
+umount "$SCRATCH_MNT"
+_check_scratch_fs
+
+echo "Remove all files and recheck"
+_scratch_mount >> "$seqres.full" 2>&1
+umount "$SCRATCH_MNT"
+_check_scratch_fs
+
+# success, all done
+status=0
+exit
tests/generic/840.out new file +0 -0
new file mode 100644
index 0000000..e69de29
tests/generic/841 new file +81 -0

81 lines not on this page · raw message

tests/generic/841.out new file +5 -0
new file mode 100644
index 0000000..33c46fd
@@ -0,0 +1,5 @@
+QA output created by 841
+Format and mount
+Create a big file
+Try to reflink
+Check scratch fs
tests/generic/group +2 -0
index 90f28aa..eef608f 100644
@@ -247,4 +247,6 @@
 837 auto quick clone
 838 auto quick clone
 839 auto quick clone
+840 clone_stress
+841 clone_stress
 846 auto quick clone

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#11 lore raw

PATCH 11/11 reflink: test that CoW writes fail when we're out of space

In reply to Darrick J. Wong

Ensure that copy-on-writing a reflinked file when there's no free disk space reflects the desired ENOSPC back to userspace during the write call. Tests the buffered IO, direct IO, and mmap write paths.

---
 common/rc             |    2 -
 tests/generic/842     |  107 ++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/842.out |   10 ++++
 tests/generic/843     |  107 ++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/843.out |   10 ++++
 tests/generic/844     |  109 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/844.out |    8 ++++
 tests/generic/845     |  107 ++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/845.out |   10 ++++
 tests/generic/group   |    4 ++
 10 files changed, 473 insertions(+), 1 deletion(-)
 create mode 100755 tests/generic/842
 create mode 100644 tests/generic/842.out
 create mode 100755 tests/generic/843
 create mode 100644 tests/generic/843.out
 create mode 100755 tests/generic/844
 create mode 100644 tests/generic/844.out
 create mode 100755 tests/generic/845
 create mode 100644 tests/generic/845.out
common/rc +1 -1
index c016673..474fa84 100644
@@ -101,7 +101,7 @@ _mwrite_byte() {
 	mmap_len="$4"
 	file="$5"
 
-	"$XFS_IO_PROG" -f -c "mmap -rw 0 $mmap_len" -c "pwrite -S $pattern $offset $len" "$file"
+	"$XFS_IO_PROG" -f -c "mmap -rw 0 $mmap_len" -c "mwrite -S $pattern $offset $len" "$file"
 }
 
 # ls -l w/ selinux sometimes puts a dot at the end:
tests/generic/842 new file +107 -0

107 lines not on this page · raw message

tests/generic/842.out new file +10 -0
new file mode 100644
index 0000000..df58025
@@ -0,0 +1,10 @@
+QA output created by 842
+Format and mount
+Reformat with appropriate size
+Create a big file and reflink it
+Allocate the rest of the space
+CoW the big file
+pwrite64: No space left on device
+Remount and try CoW again
+pwrite64: No space left on device
+Check scratch fs
tests/generic/843 new file +107 -0

107 lines not on this page · raw message

tests/generic/843.out new file +10 -0
new file mode 100644
index 0000000..43c1cf6
@@ -0,0 +1,10 @@
+QA output created by 843
+Format and mount
+Reformat with appropriate size
+Create a big file and reflink it
+Allocate the rest of the space
+CoW the big file
+pwrite64: No space left on device
+Remount and try CoW again
+pwrite64: No space left on device
+Check scratch fs
tests/generic/844 new file +109 -0

109 lines not on this page · raw message

tests/generic/844.out new file +8 -0
new file mode 100644
index 0000000..130afc1
@@ -0,0 +1,8 @@
+QA output created by 844
+Format and mount
+Reformat with appropriate size
+Create a big file and reflink it
+Allocate the rest of the space
+mmap CoW the big file
+Remount and try CoW again
+Check scratch fs
tests/generic/845 new file +107 -0

107 lines not on this page · raw message

tests/generic/845.out new file +10 -0
new file mode 100644
index 0000000..d367a73
@@ -0,0 +1,10 @@
+QA output created by 845
+Format and mount
+Reformat with appropriate size
+Create a big file and reflink it
+Allocate the rest of the space
+CoW the big file
+pwrite64: No space left on device
+Remount and try CoW again
+pwrite64: No space left on device
+Check scratch fs
tests/generic/group +4 -0
index eef608f..e184473 100644
@@ -249,4 +249,8 @@
 839 auto quick clone
 840 clone_stress
 841 clone_stress
+842 auto quick clone
+843 auto quick clone
+844 auto quick clone
+845 auto quick clone
 846 auto quick clone

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#13 lore raw
Quoted 3 lines · Christoph Hellwig

Looks fine:

Actually I take this back. I had though this was the existing series with my fixes, but this one still incorrectly assumes that if reflink works dedup works as well, leading to lots of false failures on nfs.

#14 lore raw
Quoted 8 lines · Christoph Hellwig
Quoted 3 lines · Christoph Hellwig

Looks fine:

Actually I take this back. I had though this was the existing series with my fixes, but this one still incorrectly assumes that if reflink works dedup works as well, leading to lots of false failures on nfs.

Bleargh, _require_*_dedupe forgot to check for ENOTTY output, so all the dedupe tests should have _notrun.

Also, generic/806 was calling the wrong _require.

I'll start renumbering tests; Christoph, did you see anything else?

--D

Quoted 4 lines

--
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

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#15 lore raw
Quoted 6 lines · Darrick J. Wong

Bleargh, _require_*_dedupe forgot to check for ENOTTY output, so all the dedupe tests should have _notrun.

Also, generic/806 was calling the wrong _require.

I'll start renumbering tests; Christoph, did you see anything else?

Looks fine so far otherwise.

#16 lore raw
Quoted 9 lines · Christoph Hellwig
Quoted 6 lines · Darrick J. Wong

Bleargh, _require_*_dedupe forgot to check for ENOTTY output, so all the dedupe tests should have _notrun.

Also, generic/806 was calling the wrong _require.

I'll start renumbering tests; Christoph, did you see anything else?

Looks fine so far otherwise.

I think I got all the tests renumbered correctly and fixed all the other bugs. I'd like to send the updated patchpile to Dave tomorrow, but if you have a few spare cycles would you mind giving this a quick test to make sure I fixed everything?

https://github.com/djwong/xfstests/tree/for-dave

--D

Quoted 4 lines

--
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

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#17 lore raw
Quoted 6 lines · Darrick J. Wong

I think I got all the tests renumbered correctly and fixed all the other bugs. I'd like to send the updated patchpile to Dave tomorrow, but if you have a few spare cycles would you mind giving this a quick test to make sure I fixed everything?

https://github.com/djwong/xfstests/tree/for-dave

Looks good enough to go in

I have for failing tests on NFS currently. Two of them probably are NFS issues (free block count), but and two others fail because NFS doesn't support chattr/lsattr. I will send an incremental check to adda feature test for those.

#18 lore raw
Quoted 8 lines · Christoph Hellwig
Quoted 6 lines · Darrick J. Wong

I think I got all the tests renumbered correctly and fixed all the other bugs. I'd like to send the updated patchpile to Dave tomorrow, but if you have a few spare cycles would you mind giving this a quick test to make sure I fixed everything?

https://github.com/djwong/xfstests/tree/for-dave

Quoted 8 lines

Looks good enough to go in

I have for failing tests on NFS currently. Two of them probably are NFS issues (free block count), but and two others fail because NFS doesn't support chattr/lsattr. I will send an incremental check to adda feature test for those.

I separated the chattr +i tests into a separate test that doesn't run if lsattr doesn't make sense; will post patches shortly.

--D

Quoted 5 lines

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs