All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 00/12] xfstests: minor fixes for the reflink/dedupe tests
@ 2016-03-05  0:37 ` Darrick J. Wong
  0 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:37 UTC (permalink / raw)
  To: david, darrick.wong; +Cc: linux-ext4, linux-btrfs, fstests, xfs

This is a patch set for xfstests, associated with the fifth revision
to a patch series adding reverse mapping and reflink to XFS.  Patches
1, 3-9, and 11 are bug fixes to existing reflink tests.

Patches 2 and 10 add a few more XFS-specific reflink tests to ensure
that we get the CoW and metadata reservation accounting correct.

Patch 12 adds tests for the new block device fallocate call; don't
bother merging it unless the corresponding kernel patches aren't
shouted down after a reasonable amount of time.

Comments and questions are, as always, welcome.  The fixes are
available on github[1].

--D

[1] https://github.com/djwong/xfstests/tree/reflink-devel

^ permalink raw reply	[flat|nested] 64+ messages in thread

* [PATCH v5 00/12] xfstests: minor fixes for the reflink/dedupe tests
@ 2016-03-05  0:37 ` Darrick J. Wong
  0 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:37 UTC (permalink / raw)
  To: david, darrick.wong; +Cc: linux-ext4, fstests, linux-btrfs, xfs

This is a patch set for xfstests, associated with the fifth revision
to a patch series adding reverse mapping and reflink to XFS.  Patches
1, 3-9, and 11 are bug fixes to existing reflink tests.

Patches 2 and 10 add a few more XFS-specific reflink tests to ensure
that we get the CoW and metadata reservation accounting correct.

Patch 12 adds tests for the new block device fallocate call; don't
bother merging it unless the corresponding kernel patches aren't
shouted down after a reasonable amount of time.

Comments and questions are, as always, welcome.  The fixes are
available on github[1].

--D

[1] https://github.com/djwong/xfstests/tree/reflink-devel

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 64+ messages in thread

* [PATCH 01/12] xfs/207: fix golden output to match FS_IOC_FSSETXATTR hoist
  2016-03-05  0:37 ` Darrick J. Wong
@ 2016-03-05  0:37   ` Darrick J. Wong
  -1 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:37 UTC (permalink / raw)
  To: david, darrick.wong; +Cc: linux-ext4, linux-btrfs, fstests, xfs

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/207.out |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)


diff --git a/tests/xfs/207.out b/tests/xfs/207.out
index 14eede4..434b8d9 100644
--- a/tests/xfs/207.out
+++ b/tests/xfs/207.out
@@ -3,7 +3,7 @@ Format and mount
 Create the original files
 Set extsz and cowextsz on zero byte file
 Set extsz and cowextsz on 1Mbyte file
-xfs_io: XFS_IOC_FSSETXATTR SCRATCH_MNT/test-207/file2: Invalid argument
+xfs_io: FS_IOC_FSSETXATTR SCRATCH_MNT/test-207/file2: Invalid argument
 Check extsz and cowextsz settings on zero byte file
 [1048576] SCRATCH_MNT/test-207/file1
 [1048576] SCRATCH_MNT/test-207/file1
@@ -11,8 +11,8 @@ Check extsz and cowextsz settings on 1Mbyte file
 [0] SCRATCH_MNT/test-207/file2
 [1048576] SCRATCH_MNT/test-207/file2
 Set cowextsize and check flag
-fsxattr.xflags = 0x20000 [---------------C]
+fsxattr.xflags = 0x20000 [----------------C]
 [1048576] SCRATCH_MNT/test-207/file3
 Unset cowextsize and check flag
-fsxattr.xflags = 0x0 [----------------]
+fsxattr.xflags = 0x0 [-----------------]
 [0] SCRATCH_MNT/test-207/file3


^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH 01/12] xfs/207: fix golden output to match FS_IOC_FSSETXATTR hoist
@ 2016-03-05  0:37   ` Darrick J. Wong
  0 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:37 UTC (permalink / raw)
  To: david, darrick.wong; +Cc: linux-ext4, fstests, linux-btrfs, xfs

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/207.out |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)


diff --git a/tests/xfs/207.out b/tests/xfs/207.out
index 14eede4..434b8d9 100644
--- a/tests/xfs/207.out
+++ b/tests/xfs/207.out
@@ -3,7 +3,7 @@ Format and mount
 Create the original files
 Set extsz and cowextsz on zero byte file
 Set extsz and cowextsz on 1Mbyte file
-xfs_io: XFS_IOC_FSSETXATTR SCRATCH_MNT/test-207/file2: Invalid argument
+xfs_io: FS_IOC_FSSETXATTR SCRATCH_MNT/test-207/file2: Invalid argument
 Check extsz and cowextsz settings on zero byte file
 [1048576] SCRATCH_MNT/test-207/file1
 [1048576] SCRATCH_MNT/test-207/file1
@@ -11,8 +11,8 @@ Check extsz and cowextsz settings on 1Mbyte file
 [0] SCRATCH_MNT/test-207/file2
 [1048576] SCRATCH_MNT/test-207/file2
 Set cowextsize and check flag
-fsxattr.xflags = 0x20000 [---------------C]
+fsxattr.xflags = 0x20000 [----------------C]
 [1048576] SCRATCH_MNT/test-207/file3
 Unset cowextsize and check flag
-fsxattr.xflags = 0x0 [----------------]
+fsxattr.xflags = 0x0 [-----------------]
 [0] SCRATCH_MNT/test-207/file3

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH 02/12] xfs: test copy-on-write leftover recovery
  2016-03-05  0:37 ` Darrick J. Wong
@ 2016-03-05  0:37   ` Darrick J. Wong
  -1 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:37 UTC (permalink / raw)
  To: david, darrick.wong; +Cc: linux-ext4, linux-btrfs, fstests, xfs

Test recovery of CoW leftovers in xfs_repair.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/853     |  179 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/xfs/853.out |   13 ++++
 tests/xfs/854     |  180 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/xfs/854.out |   13 ++++
 tests/xfs/group   |    2 +
 5 files changed, 387 insertions(+)
 create mode 100755 tests/xfs/853
 create mode 100644 tests/xfs/853.out
 create mode 100755 tests/xfs/854
 create mode 100644 tests/xfs/854.out


diff --git a/tests/xfs/853 b/tests/xfs/853
new file mode 100755
index 0000000..14a6940
--- /dev/null
+++ b/tests/xfs/853
@@ -0,0 +1,179 @@
+#! /bin/bash
+# FS QA Test No. 853
+#
+# Test recovery of "lost" CoW blocks:
+# - Use the debugger to fake a leftover CoW extent
+# - See if xfs_repair fixes it
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016, 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.*
+}
+
+# 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
+
+rm -f $seqres.full
+
+echo "Format"
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full
+is_rmap=$(xfs_info $SCRATCH_MNT | grep -c "rmapbt=1")
+umount $SCRATCH_MNT
+
+_get_agf_data() {
+	field="$1"
+	shift
+
+	xfs_db -c 'agf 1' "$@" -c "p $field" $SCRATCH_DEV | awk '{print $3}'
+}
+
+_set_agf_data() {
+	field="$1"
+	value="$2"
+	shift; shift
+
+	xfs_db -x -c 'agf 1' "$@" -c "write $field -- $value" $SCRATCH_DEV >> $seqres.full
+}
+
+_get_sb_data() {
+	field="$1"
+	shift
+
+	xfs_db -c 'sb 0' "$@" -c "p $field" $SCRATCH_DEV | awk '{print $3}'
+}
+
+_set_sb_data() {
+	field="$1"
+	value="$2"
+	shift; shift
+
+	xfs_db -x -c 'sb 0' "$@" -c "write $field -- $value" $SCRATCH_DEV >> $seqres.full
+}
+
+_filter_leftover() {
+	grep "^leftover" | sed -e "s/[0-9]\+/NR/g"
+}
+
+_dump_status() {
+	echo "** " "$@"
+	xfs_db -c 'sb 0' -c p $SCRATCH_DEV
+	echo "** agf header"
+	xfs_db -c 'agf 1' -c p $SCRATCH_DEV
+	echo "** refcntbt"
+	xfs_db -c 'agf 1' -c 'addr refcntroot' -c p $SCRATCH_DEV
+	echo "** rmapbt"
+	test $is_rmap -gt 0 && xfs_db -c 'agf 1' -c 'addr rmaproot' -c p $SCRATCH_DEV
+	echo "** bnobt"
+	xfs_db -c 'agf 1' -c 'addr bnoroot' -c p $SCRATCH_DEV
+	echo "** cntbt"
+	xfs_db -c 'agf 1' -c 'addr cntroot' -c p $SCRATCH_DEV
+}
+
+echo "We need AG1 to have a single free extent"
+bno_lvl=$(_get_agf_data level -c 'addr bnoroot')
+bno_nr=$(_get_agf_data numrecs -c 'addr bnoroot')
+refc_lvl=$(_get_agf_data level -c 'addr refcntroot')
+refc_nr=$(_get_agf_data numrecs -c 'addr refcntroot')
+
+test $bno_lvl -eq 0 || echo "  AG 1 bnobt must only have one level"
+test $bno_nr -eq 1 || echo "  AG 1 bnobt must only have one record"
+test $refc_lvl -eq 0 || echo "  AG 1 refcountbt must only have one level"
+test $refc_nr -eq 0 || echo "  AG 1 refcountbt must only have one record"
+
+if [ $is_rmap -gt 0 ]; then
+	rmap_lvl=$(_get_agf_data level -c 'addr rmaproot')
+	rmap_nr=$(_get_agf_data numrecs -c 'addr rmaproot')
+	test $rmap_lvl -eq 0 || echo "  AG 1 rmapbt must only have one level"
+fi
+
+echo "Find our extent and old counter values"
+bno=$(_get_agf_data "recs[1].startblock" -c 'addr bnoroot')
+len=$(_get_agf_data "recs[1].blockcount" -c 'addr bnoroot')
+agf_freeblks=$(_get_agf_data freeblks)
+sb_fdblocks=$(_get_sb_data fdblocks)
+
+test $len -ge 200 || echo "  AG 1 doesn't have enough free blocks"
+
+# Take the last 100 blocks of the free extent
+debris_len=100
+debris_bno=$((bno + len - debris_len))
+
+echo "Remove the extent from the freesp btrees"
+_set_agf_data "recs[1].blockcount" $((len - debris_len)) -c 'addr bnoroot'
+_set_agf_data "recs[1].blockcount" $((len - debris_len)) -c 'addr cntroot'
+_set_agf_data freeblks $((agf_freeblks - debris_len))
+_set_agf_data longest $((len - debris_len))
+_set_sb_data fdblocks $((sb_fdblocks - debris_len))
+
+echo "Add the extent to the refcount btree"
+_set_agf_data numrecs 1 -c 'addr refcntroot'
+_set_agf_data "recs[1].startblock" $debris_bno -c 'addr refcntroot'
+_set_agf_data "recs[1].blockcount" $debris_len -c 'addr refcntroot'
+_set_agf_data "recs[1].refcount" 1 -c 'addr refcntroot'
+
+if [ $is_rmap -gt 0 ]; then
+	rmap_nr=$((rmap_nr + 1))
+	_set_agf_data numrecs $rmap_nr -c 'addr rmaproot'
+	_set_agf_data "recs[$rmap_nr].startblock" $debris_bno -c 'addr rmaproot'
+	_set_agf_data "recs[$rmap_nr].blockcount" $debris_len -c 'addr rmaproot'
+	_set_agf_data "recs[$rmap_nr].owner" -9 -c 'addr rmaproot'
+	_set_agf_data "recs[$rmap_nr].offset" 0 -c 'addr rmaproot'
+fi
+
+_dump_status "broken fs config" >> $seqres.full
+
+echo "Look for leftover warning in xfs_check"
+_scratch_xfs_check | _filter_leftover
+
+echo "Look for leftover warning in xfs_repair"
+_scratch_xfs_repair -n 2>&1 | _filter_leftover
+
+echo "Fix filesystem"
+_scratch_xfs_repair >> $seqres.full 2>&1 || echo "xfs_repair failed?"
+
+_dump_status "supposedly fixed fs config" >> $seqres.full
+
+echo "Look for no more leftover warning in xfs_check"
+_scratch_xfs_check | _filter_leftover
+
+echo "Look for no more leftover warning in xfs_repair"
+_scratch_xfs_repair -n 2>&1 | _filter_leftover
+
+# success, all done
+status=0
+exit
diff --git a/tests/xfs/853.out b/tests/xfs/853.out
new file mode 100644
index 0000000..3224e8d
--- /dev/null
+++ b/tests/xfs/853.out
@@ -0,0 +1,13 @@
+QA output created by 853
+Format
+We need AG1 to have a single free extent
+Find our extent and old counter values
+Remove the extent from the freesp btrees
+Add the extent to the refcount btree
+Look for leftover warning in xfs_check
+leftover CoW extent (NR/NR) len NR
+Look for leftover warning in xfs_repair
+leftover CoW extent (NR/NR) len NR
+Fix filesystem
+Look for no more leftover warning in xfs_check
+Look for no more leftover warning in xfs_repair
diff --git a/tests/xfs/854 b/tests/xfs/854
new file mode 100755
index 0000000..5c6bec9
--- /dev/null
+++ b/tests/xfs/854
@@ -0,0 +1,180 @@
+#! /bin/bash
+# FS QA Test No. 854
+#
+# Test recovery of "lost" CoW blocks:
+# - Use the debugger to fake a leftover CoW extent
+# - See if mount/umount fixes it
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016, 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.*
+}
+
+# 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
+
+rm -f $seqres.full
+
+echo "Format"
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full
+is_rmap=$(xfs_info $SCRATCH_MNT | grep -c "rmapbt=1")
+umount $SCRATCH_MNT
+
+_get_agf_data() {
+	field="$1"
+	shift
+
+	xfs_db -c 'agf 1' "$@" -c "p $field" $SCRATCH_DEV | awk '{print $3}'
+}
+
+_set_agf_data() {
+	field="$1"
+	value="$2"
+	shift; shift
+
+	xfs_db -x -c 'agf 1' "$@" -c "write $field -- $value" $SCRATCH_DEV >> $seqres.full
+}
+
+_get_sb_data() {
+	field="$1"
+	shift
+
+	xfs_db -c 'sb 0' "$@" -c "p $field" $SCRATCH_DEV | awk '{print $3}'
+}
+
+_set_sb_data() {
+	field="$1"
+	value="$2"
+	shift; shift
+
+	xfs_db -x -c 'sb 0' "$@" -c "write $field -- $value" $SCRATCH_DEV >> $seqres.full
+}
+
+_filter_leftover() {
+	grep "^leftover" | sed -e "s/[0-9]\+/NR/g"
+}
+
+_dump_status() {
+	echo "** " "$@"
+	xfs_db -c 'sb 0' -c p $SCRATCH_DEV
+	echo "** agf header"
+	xfs_db -c 'agf 1' -c p $SCRATCH_DEV
+	echo "** refcntbt"
+	xfs_db -c 'agf 1' -c 'addr refcntroot' -c p $SCRATCH_DEV
+	echo "** rmapbt"
+	test $is_rmap -gt 0 && xfs_db -c 'agf 1' -c 'addr rmaproot' -c p $SCRATCH_DEV
+	echo "** bnobt"
+	xfs_db -c 'agf 1' -c 'addr bnoroot' -c p $SCRATCH_DEV
+	echo "** cntbt"
+	xfs_db -c 'agf 1' -c 'addr cntroot' -c p $SCRATCH_DEV
+}
+
+echo "We need AG1 to have a single free extent"
+bno_lvl=$(_get_agf_data level -c 'addr bnoroot')
+bno_nr=$(_get_agf_data numrecs -c 'addr bnoroot')
+refc_lvl=$(_get_agf_data level -c 'addr refcntroot')
+refc_nr=$(_get_agf_data numrecs -c 'addr refcntroot')
+
+test $bno_lvl -eq 0 || echo "  AG 1 bnobt must only have one level"
+test $bno_nr -eq 1 || echo "  AG 1 bnobt must only have one record"
+test $refc_lvl -eq 0 || echo "  AG 1 refcountbt must only have one level"
+test $refc_nr -eq 0 || echo "  AG 1 refcountbt must only have one record"
+
+if [ $is_rmap -gt 0 ]; then
+	rmap_lvl=$(_get_agf_data level -c 'addr rmaproot')
+	rmap_nr=$(_get_agf_data numrecs -c 'addr rmaproot')
+	test $rmap_lvl -eq 0 || echo "  AG 1 rmapbt must only have one level"
+fi
+
+echo "Find our extent and old counter values"
+bno=$(_get_agf_data "recs[1].startblock" -c 'addr bnoroot')
+len=$(_get_agf_data "recs[1].blockcount" -c 'addr bnoroot')
+agf_freeblks=$(_get_agf_data freeblks)
+sb_fdblocks=$(_get_sb_data fdblocks)
+
+test $len -ge 200 || echo "  AG 1 doesn't have enough free blocks"
+
+# Take the last 100 blocks of the free extent
+debris_len=100
+debris_bno=$((bno + len - debris_len))
+
+echo "Remove the extent from the freesp btrees"
+_set_agf_data "recs[1].blockcount" $((len - debris_len)) -c 'addr bnoroot'
+_set_agf_data "recs[1].blockcount" $((len - debris_len)) -c 'addr cntroot'
+_set_agf_data freeblks $((agf_freeblks - debris_len))
+_set_agf_data longest $((len - debris_len))
+_set_sb_data fdblocks $((sb_fdblocks - debris_len))
+
+echo "Add the extent to the refcount btree"
+_set_agf_data numrecs 1 -c 'addr refcntroot'
+_set_agf_data "recs[1].startblock" $debris_bno -c 'addr refcntroot'
+_set_agf_data "recs[1].blockcount" $debris_len -c 'addr refcntroot'
+_set_agf_data "recs[1].refcount" 1 -c 'addr refcntroot'
+
+if [ $is_rmap -gt 0 ]; then
+	rmap_nr=$((rmap_nr + 1))
+	_set_agf_data numrecs $rmap_nr -c 'addr rmaproot'
+	_set_agf_data "recs[$rmap_nr].startblock" $debris_bno -c 'addr rmaproot'
+	_set_agf_data "recs[$rmap_nr].blockcount" $debris_len -c 'addr rmaproot'
+	_set_agf_data "recs[$rmap_nr].owner" -9 -c 'addr rmaproot'
+	_set_agf_data "recs[$rmap_nr].offset" 0 -c 'addr rmaproot'
+fi
+
+_dump_status "broken fs config" >> $seqres.full
+
+echo "Look for leftover warning in xfs_check"
+_scratch_xfs_check | _filter_leftover
+
+echo "Look for leftover warning in xfs_repair"
+_scratch_xfs_repair -n 2>&1 | _filter_leftover
+
+echo "Mount filesystem"
+_scratch_mount
+umount $SCRATCH_MNT
+
+_dump_status "supposedly fixed fs config" >> $seqres.full
+
+echo "Look for no more leftover warning in xfs_check"
+_scratch_xfs_check | _filter_leftover
+
+echo "Look for no more leftover warning in xfs_repair"
+_scratch_xfs_repair -n 2>&1 | _filter_leftover
+
+# success, all done
+status=0
+exit
diff --git a/tests/xfs/854.out b/tests/xfs/854.out
new file mode 100644
index 0000000..aae2fd7
--- /dev/null
+++ b/tests/xfs/854.out
@@ -0,0 +1,13 @@
+QA output created by 854
+Format
+We need AG1 to have a single free extent
+Find our extent and old counter values
+Remove the extent from the freesp btrees
+Add the extent to the refcount btree
+Look for leftover warning in xfs_check
+leftover CoW extent (NR/NR) len NR
+Look for leftover warning in xfs_repair
+leftover CoW extent (NR/NR) len NR
+Mount filesystem
+Look for no more leftover warning in xfs_check
+Look for no more leftover warning in xfs_repair
diff --git a/tests/xfs/group b/tests/xfs/group
index e0c4553..50353f1 100644
--- a/tests/xfs/group
+++ b/tests/xfs/group
@@ -284,3 +284,5 @@
 303 auto quick quota
 304 auto quick quota
 305 auto quota
+853 auto quick clone
+854 auto quick clone


^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH 02/12] xfs: test copy-on-write leftover recovery
@ 2016-03-05  0:37   ` Darrick J. Wong
  0 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:37 UTC (permalink / raw)
  To: david, darrick.wong; +Cc: linux-ext4, fstests, linux-btrfs, xfs

Test recovery of CoW leftovers in xfs_repair.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/853     |  179 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/xfs/853.out |   13 ++++
 tests/xfs/854     |  180 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/xfs/854.out |   13 ++++
 tests/xfs/group   |    2 +
 5 files changed, 387 insertions(+)
 create mode 100755 tests/xfs/853
 create mode 100644 tests/xfs/853.out
 create mode 100755 tests/xfs/854
 create mode 100644 tests/xfs/854.out


diff --git a/tests/xfs/853 b/tests/xfs/853
new file mode 100755
index 0000000..14a6940
--- /dev/null
+++ b/tests/xfs/853
@@ -0,0 +1,179 @@
+#! /bin/bash
+# FS QA Test No. 853
+#
+# Test recovery of "lost" CoW blocks:
+# - Use the debugger to fake a leftover CoW extent
+# - See if xfs_repair fixes it
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016, 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.*
+}
+
+# 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
+
+rm -f $seqres.full
+
+echo "Format"
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full
+is_rmap=$(xfs_info $SCRATCH_MNT | grep -c "rmapbt=1")
+umount $SCRATCH_MNT
+
+_get_agf_data() {
+	field="$1"
+	shift
+
+	xfs_db -c 'agf 1' "$@" -c "p $field" $SCRATCH_DEV | awk '{print $3}'
+}
+
+_set_agf_data() {
+	field="$1"
+	value="$2"
+	shift; shift
+
+	xfs_db -x -c 'agf 1' "$@" -c "write $field -- $value" $SCRATCH_DEV >> $seqres.full
+}
+
+_get_sb_data() {
+	field="$1"
+	shift
+
+	xfs_db -c 'sb 0' "$@" -c "p $field" $SCRATCH_DEV | awk '{print $3}'
+}
+
+_set_sb_data() {
+	field="$1"
+	value="$2"
+	shift; shift
+
+	xfs_db -x -c 'sb 0' "$@" -c "write $field -- $value" $SCRATCH_DEV >> $seqres.full
+}
+
+_filter_leftover() {
+	grep "^leftover" | sed -e "s/[0-9]\+/NR/g"
+}
+
+_dump_status() {
+	echo "** " "$@"
+	xfs_db -c 'sb 0' -c p $SCRATCH_DEV
+	echo "** agf header"
+	xfs_db -c 'agf 1' -c p $SCRATCH_DEV
+	echo "** refcntbt"
+	xfs_db -c 'agf 1' -c 'addr refcntroot' -c p $SCRATCH_DEV
+	echo "** rmapbt"
+	test $is_rmap -gt 0 && xfs_db -c 'agf 1' -c 'addr rmaproot' -c p $SCRATCH_DEV
+	echo "** bnobt"
+	xfs_db -c 'agf 1' -c 'addr bnoroot' -c p $SCRATCH_DEV
+	echo "** cntbt"
+	xfs_db -c 'agf 1' -c 'addr cntroot' -c p $SCRATCH_DEV
+}
+
+echo "We need AG1 to have a single free extent"
+bno_lvl=$(_get_agf_data level -c 'addr bnoroot')
+bno_nr=$(_get_agf_data numrecs -c 'addr bnoroot')
+refc_lvl=$(_get_agf_data level -c 'addr refcntroot')
+refc_nr=$(_get_agf_data numrecs -c 'addr refcntroot')
+
+test $bno_lvl -eq 0 || echo "  AG 1 bnobt must only have one level"
+test $bno_nr -eq 1 || echo "  AG 1 bnobt must only have one record"
+test $refc_lvl -eq 0 || echo "  AG 1 refcountbt must only have one level"
+test $refc_nr -eq 0 || echo "  AG 1 refcountbt must only have one record"
+
+if [ $is_rmap -gt 0 ]; then
+	rmap_lvl=$(_get_agf_data level -c 'addr rmaproot')
+	rmap_nr=$(_get_agf_data numrecs -c 'addr rmaproot')
+	test $rmap_lvl -eq 0 || echo "  AG 1 rmapbt must only have one level"
+fi
+
+echo "Find our extent and old counter values"
+bno=$(_get_agf_data "recs[1].startblock" -c 'addr bnoroot')
+len=$(_get_agf_data "recs[1].blockcount" -c 'addr bnoroot')
+agf_freeblks=$(_get_agf_data freeblks)
+sb_fdblocks=$(_get_sb_data fdblocks)
+
+test $len -ge 200 || echo "  AG 1 doesn't have enough free blocks"
+
+# Take the last 100 blocks of the free extent
+debris_len=100
+debris_bno=$((bno + len - debris_len))
+
+echo "Remove the extent from the freesp btrees"
+_set_agf_data "recs[1].blockcount" $((len - debris_len)) -c 'addr bnoroot'
+_set_agf_data "recs[1].blockcount" $((len - debris_len)) -c 'addr cntroot'
+_set_agf_data freeblks $((agf_freeblks - debris_len))
+_set_agf_data longest $((len - debris_len))
+_set_sb_data fdblocks $((sb_fdblocks - debris_len))
+
+echo "Add the extent to the refcount btree"
+_set_agf_data numrecs 1 -c 'addr refcntroot'
+_set_agf_data "recs[1].startblock" $debris_bno -c 'addr refcntroot'
+_set_agf_data "recs[1].blockcount" $debris_len -c 'addr refcntroot'
+_set_agf_data "recs[1].refcount" 1 -c 'addr refcntroot'
+
+if [ $is_rmap -gt 0 ]; then
+	rmap_nr=$((rmap_nr + 1))
+	_set_agf_data numrecs $rmap_nr -c 'addr rmaproot'
+	_set_agf_data "recs[$rmap_nr].startblock" $debris_bno -c 'addr rmaproot'
+	_set_agf_data "recs[$rmap_nr].blockcount" $debris_len -c 'addr rmaproot'
+	_set_agf_data "recs[$rmap_nr].owner" -9 -c 'addr rmaproot'
+	_set_agf_data "recs[$rmap_nr].offset" 0 -c 'addr rmaproot'
+fi
+
+_dump_status "broken fs config" >> $seqres.full
+
+echo "Look for leftover warning in xfs_check"
+_scratch_xfs_check | _filter_leftover
+
+echo "Look for leftover warning in xfs_repair"
+_scratch_xfs_repair -n 2>&1 | _filter_leftover
+
+echo "Fix filesystem"
+_scratch_xfs_repair >> $seqres.full 2>&1 || echo "xfs_repair failed?"
+
+_dump_status "supposedly fixed fs config" >> $seqres.full
+
+echo "Look for no more leftover warning in xfs_check"
+_scratch_xfs_check | _filter_leftover
+
+echo "Look for no more leftover warning in xfs_repair"
+_scratch_xfs_repair -n 2>&1 | _filter_leftover
+
+# success, all done
+status=0
+exit
diff --git a/tests/xfs/853.out b/tests/xfs/853.out
new file mode 100644
index 0000000..3224e8d
--- /dev/null
+++ b/tests/xfs/853.out
@@ -0,0 +1,13 @@
+QA output created by 853
+Format
+We need AG1 to have a single free extent
+Find our extent and old counter values
+Remove the extent from the freesp btrees
+Add the extent to the refcount btree
+Look for leftover warning in xfs_check
+leftover CoW extent (NR/NR) len NR
+Look for leftover warning in xfs_repair
+leftover CoW extent (NR/NR) len NR
+Fix filesystem
+Look for no more leftover warning in xfs_check
+Look for no more leftover warning in xfs_repair
diff --git a/tests/xfs/854 b/tests/xfs/854
new file mode 100755
index 0000000..5c6bec9
--- /dev/null
+++ b/tests/xfs/854
@@ -0,0 +1,180 @@
+#! /bin/bash
+# FS QA Test No. 854
+#
+# Test recovery of "lost" CoW blocks:
+# - Use the debugger to fake a leftover CoW extent
+# - See if mount/umount fixes it
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016, 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.*
+}
+
+# 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
+
+rm -f $seqres.full
+
+echo "Format"
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full
+is_rmap=$(xfs_info $SCRATCH_MNT | grep -c "rmapbt=1")
+umount $SCRATCH_MNT
+
+_get_agf_data() {
+	field="$1"
+	shift
+
+	xfs_db -c 'agf 1' "$@" -c "p $field" $SCRATCH_DEV | awk '{print $3}'
+}
+
+_set_agf_data() {
+	field="$1"
+	value="$2"
+	shift; shift
+
+	xfs_db -x -c 'agf 1' "$@" -c "write $field -- $value" $SCRATCH_DEV >> $seqres.full
+}
+
+_get_sb_data() {
+	field="$1"
+	shift
+
+	xfs_db -c 'sb 0' "$@" -c "p $field" $SCRATCH_DEV | awk '{print $3}'
+}
+
+_set_sb_data() {
+	field="$1"
+	value="$2"
+	shift; shift
+
+	xfs_db -x -c 'sb 0' "$@" -c "write $field -- $value" $SCRATCH_DEV >> $seqres.full
+}
+
+_filter_leftover() {
+	grep "^leftover" | sed -e "s/[0-9]\+/NR/g"
+}
+
+_dump_status() {
+	echo "** " "$@"
+	xfs_db -c 'sb 0' -c p $SCRATCH_DEV
+	echo "** agf header"
+	xfs_db -c 'agf 1' -c p $SCRATCH_DEV
+	echo "** refcntbt"
+	xfs_db -c 'agf 1' -c 'addr refcntroot' -c p $SCRATCH_DEV
+	echo "** rmapbt"
+	test $is_rmap -gt 0 && xfs_db -c 'agf 1' -c 'addr rmaproot' -c p $SCRATCH_DEV
+	echo "** bnobt"
+	xfs_db -c 'agf 1' -c 'addr bnoroot' -c p $SCRATCH_DEV
+	echo "** cntbt"
+	xfs_db -c 'agf 1' -c 'addr cntroot' -c p $SCRATCH_DEV
+}
+
+echo "We need AG1 to have a single free extent"
+bno_lvl=$(_get_agf_data level -c 'addr bnoroot')
+bno_nr=$(_get_agf_data numrecs -c 'addr bnoroot')
+refc_lvl=$(_get_agf_data level -c 'addr refcntroot')
+refc_nr=$(_get_agf_data numrecs -c 'addr refcntroot')
+
+test $bno_lvl -eq 0 || echo "  AG 1 bnobt must only have one level"
+test $bno_nr -eq 1 || echo "  AG 1 bnobt must only have one record"
+test $refc_lvl -eq 0 || echo "  AG 1 refcountbt must only have one level"
+test $refc_nr -eq 0 || echo "  AG 1 refcountbt must only have one record"
+
+if [ $is_rmap -gt 0 ]; then
+	rmap_lvl=$(_get_agf_data level -c 'addr rmaproot')
+	rmap_nr=$(_get_agf_data numrecs -c 'addr rmaproot')
+	test $rmap_lvl -eq 0 || echo "  AG 1 rmapbt must only have one level"
+fi
+
+echo "Find our extent and old counter values"
+bno=$(_get_agf_data "recs[1].startblock" -c 'addr bnoroot')
+len=$(_get_agf_data "recs[1].blockcount" -c 'addr bnoroot')
+agf_freeblks=$(_get_agf_data freeblks)
+sb_fdblocks=$(_get_sb_data fdblocks)
+
+test $len -ge 200 || echo "  AG 1 doesn't have enough free blocks"
+
+# Take the last 100 blocks of the free extent
+debris_len=100
+debris_bno=$((bno + len - debris_len))
+
+echo "Remove the extent from the freesp btrees"
+_set_agf_data "recs[1].blockcount" $((len - debris_len)) -c 'addr bnoroot'
+_set_agf_data "recs[1].blockcount" $((len - debris_len)) -c 'addr cntroot'
+_set_agf_data freeblks $((agf_freeblks - debris_len))
+_set_agf_data longest $((len - debris_len))
+_set_sb_data fdblocks $((sb_fdblocks - debris_len))
+
+echo "Add the extent to the refcount btree"
+_set_agf_data numrecs 1 -c 'addr refcntroot'
+_set_agf_data "recs[1].startblock" $debris_bno -c 'addr refcntroot'
+_set_agf_data "recs[1].blockcount" $debris_len -c 'addr refcntroot'
+_set_agf_data "recs[1].refcount" 1 -c 'addr refcntroot'
+
+if [ $is_rmap -gt 0 ]; then
+	rmap_nr=$((rmap_nr + 1))
+	_set_agf_data numrecs $rmap_nr -c 'addr rmaproot'
+	_set_agf_data "recs[$rmap_nr].startblock" $debris_bno -c 'addr rmaproot'
+	_set_agf_data "recs[$rmap_nr].blockcount" $debris_len -c 'addr rmaproot'
+	_set_agf_data "recs[$rmap_nr].owner" -9 -c 'addr rmaproot'
+	_set_agf_data "recs[$rmap_nr].offset" 0 -c 'addr rmaproot'
+fi
+
+_dump_status "broken fs config" >> $seqres.full
+
+echo "Look for leftover warning in xfs_check"
+_scratch_xfs_check | _filter_leftover
+
+echo "Look for leftover warning in xfs_repair"
+_scratch_xfs_repair -n 2>&1 | _filter_leftover
+
+echo "Mount filesystem"
+_scratch_mount
+umount $SCRATCH_MNT
+
+_dump_status "supposedly fixed fs config" >> $seqres.full
+
+echo "Look for no more leftover warning in xfs_check"
+_scratch_xfs_check | _filter_leftover
+
+echo "Look for no more leftover warning in xfs_repair"
+_scratch_xfs_repair -n 2>&1 | _filter_leftover
+
+# success, all done
+status=0
+exit
diff --git a/tests/xfs/854.out b/tests/xfs/854.out
new file mode 100644
index 0000000..aae2fd7
--- /dev/null
+++ b/tests/xfs/854.out
@@ -0,0 +1,13 @@
+QA output created by 854
+Format
+We need AG1 to have a single free extent
+Find our extent and old counter values
+Remove the extent from the freesp btrees
+Add the extent to the refcount btree
+Look for leftover warning in xfs_check
+leftover CoW extent (NR/NR) len NR
+Look for leftover warning in xfs_repair
+leftover CoW extent (NR/NR) len NR
+Mount filesystem
+Look for no more leftover warning in xfs_check
+Look for no more leftover warning in xfs_repair
diff --git a/tests/xfs/group b/tests/xfs/group
index e0c4553..50353f1 100644
--- a/tests/xfs/group
+++ b/tests/xfs/group
@@ -284,3 +284,5 @@
 303 auto quick quota
 304 auto quick quota
 305 auto quota
+853 auto quick clone
+854 auto quick clone

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH 03/12] reflink: fix fragmentation tests to work on >4k block size filesystems
  2016-03-05  0:37 ` Darrick J. Wong
@ 2016-03-05  0:37   ` Darrick J. Wong
  -1 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:37 UTC (permalink / raw)
  To: david, darrick.wong; +Cc: linux-ext4, linux-btrfs, fstests, xfs

For tests that only overwrite part of a file, only consider the number
of extents in the *rewritten* blocks when deciding if the FS
fragmentation performance is satisfactory.

(Also slip in a fix for xfs/127 so that it formats correctly when we
specify big blocksizes via MKFS_OPTIONS.)

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/127 |    2 +-
 tests/xfs/215 |    2 +-
 tests/xfs/218 |    2 +-
 tests/xfs/219 |    2 +-
 tests/xfs/221 |    2 +-
 tests/xfs/223 |    2 +-
 tests/xfs/224 |    2 +-
 tests/xfs/225 |    2 +-
 tests/xfs/226 |    2 +-
 tests/xfs/228 |    2 +-
 tests/xfs/230 |    2 +-
 tests/xfs/231 |    2 +-
 tests/xfs/232 |    2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)


diff --git a/tests/xfs/127 b/tests/xfs/127
index f44daae..6b768c9 100755
--- a/tests/xfs/127
+++ b/tests/xfs/127
@@ -48,7 +48,7 @@ _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_mkfs_sized $((2 * 4096 * 4096)) > $seqres.full 2>&1
 _scratch_mount >> $seqres.full 2>&1
 
 testdir=$SCRATCH_MNT/test-$seq
diff --git a/tests/xfs/215 b/tests/xfs/215
index 5ae4d85..7a517d7 100755
--- a/tests/xfs/215
+++ b/tests/xfs/215
@@ -95,7 +95,7 @@ new_extents=$(_count_extents $testdir/file3)
 echo "old extents: $old_extents" >> $seqres.full
 echo "new extents: $new_extents" >> $seqres.full
 echo "maximum extents: $internal_blks" >> $seqres.full
-test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented"
+test $((new_extents - (nr / 2))) -lt $((internal_blks / 2)) || echo "file3 badly fragmented"
 
 # success, all done
 status=0
diff --git a/tests/xfs/218 b/tests/xfs/218
index ea464f2..0ab4102 100755
--- a/tests/xfs/218
+++ b/tests/xfs/218
@@ -94,7 +94,7 @@ new_extents=$(_count_extents $testdir/file3)
 echo "old extents: $old_extents" >> $seqres.full
 echo "new extents: $new_extents" >> $seqres.full
 echo "maximum extents: $internal_blks" >> $seqres.full
-test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented"
+test $((new_extents - (nr / 2))) -lt $((internal_blks / 2)) || echo "file3 badly fragmented"
 
 # success, all done
 status=0
diff --git a/tests/xfs/219 b/tests/xfs/219
index 012b07c..df57e07 100755
--- a/tests/xfs/219
+++ b/tests/xfs/219
@@ -95,7 +95,7 @@ new_extents=$(_count_extents $testdir/file3)
 echo "old extents: $old_extents" >> $seqres.full
 echo "new extents: $new_extents" >> $seqres.full
 echo "maximum extents: $internal_blks" >> $seqres.full
-test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented"
+test $((new_extents - (nr / 4))) -lt $((internal_blks / 2)) || echo "file3 badly fragmented"
 
 # success, all done
 status=0
diff --git a/tests/xfs/221 b/tests/xfs/221
index 8b860f2..03d81ac 100755
--- a/tests/xfs/221
+++ b/tests/xfs/221
@@ -94,7 +94,7 @@ new_extents=$(_count_extents $testdir/file3)
 echo "old extents: $old_extents" >> $seqres.full
 echo "new extents: $new_extents" >> $seqres.full
 echo "maximum extents: $internal_blks" >> $seqres.full
-test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented"
+test $((new_extents - (nr / 4))) -lt $((internal_blks / 2)) || echo "file3 badly fragmented"
 
 # success, all done
 status=0
diff --git a/tests/xfs/223 b/tests/xfs/223
index 1e6ba98..7c990a2 100755
--- a/tests/xfs/223
+++ b/tests/xfs/223
@@ -97,7 +97,7 @@ new_extents=$(_count_extents $testdir/file3)
 echo "old extents: $old_extents" >> $seqres.full
 echo "new extents: $new_extents" >> $seqres.full
 echo "maximum extents: $internal_blks" >> $seqres.full
-test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented"
+test $((new_extents - (nr / 2))) -lt $((internal_blks / 2)) || echo "file3 badly fragmented"
 
 # success, all done
 status=0
diff --git a/tests/xfs/224 b/tests/xfs/224
index 3d19f94..bf33d1f 100755
--- a/tests/xfs/224
+++ b/tests/xfs/224
@@ -96,7 +96,7 @@ new_extents=$(_count_extents $testdir/file3)
 echo "old extents: $old_extents" >> $seqres.full
 echo "new extents: $new_extents" >> $seqres.full
 echo "maximum extents: $internal_blks" >> $seqres.full
-test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented"
+test $((new_extents - (nr / 2))) -lt $((internal_blks / 2)) || echo "file3 badly fragmented"
 
 # success, all done
 status=0
diff --git a/tests/xfs/225 b/tests/xfs/225
index c2e5b82..749816f 100755
--- a/tests/xfs/225
+++ b/tests/xfs/225
@@ -95,7 +95,7 @@ new_extents=$(_count_extents $testdir/file3)
 echo "old extents: $old_extents" >> $seqres.full
 echo "new extents: $new_extents" >> $seqres.full
 echo "maximum extents: $internal_blks" >> $seqres.full
-test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented"
+test $((new_extents - (nr / 2))) -lt $((internal_blks / 2)) || echo "file3 badly fragmented"
 
 # success, all done
 status=0
diff --git a/tests/xfs/226 b/tests/xfs/226
index 3f035b4..bb94d24 100755
--- a/tests/xfs/226
+++ b/tests/xfs/226
@@ -94,7 +94,7 @@ new_extents=$(_count_extents $testdir/file3)
 echo "old extents: $old_extents" >> $seqres.full
 echo "new extents: $new_extents" >> $seqres.full
 echo "maximum extents: $internal_blks" >> $seqres.full
-test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented"
+test $((new_extents - (nr / 2))) -lt $((internal_blks / 2)) || echo "file3 badly fragmented"
 
 # success, all done
 status=0
diff --git a/tests/xfs/228 b/tests/xfs/228
index 52fbb75..df1fd7a 100755
--- a/tests/xfs/228
+++ b/tests/xfs/228
@@ -103,7 +103,7 @@ new_extents=$(_count_extents $testdir/file3)
 echo "old extents: $old_extents" >> $seqres.full
 echo "new extents: $new_extents" >> $seqres.full
 echo "maximum extents: $internal_blks" >> $seqres.full
-test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented"
+test $((new_extents - (nr * 4 / 10))) -lt $((internal_blks / 2)) || echo "file3 badly fragmented"
 
 # success, all done
 status=0
diff --git a/tests/xfs/230 b/tests/xfs/230
index 91e4d3f..73f599a 100755
--- a/tests/xfs/230
+++ b/tests/xfs/230
@@ -103,7 +103,7 @@ new_extents=$(_count_extents $testdir/file3)
 echo "old extents: $old_extents" >> $seqres.full
 echo "new extents: $new_extents" >> $seqres.full
 echo "maximum extents: $internal_blks" >> $seqres.full
-test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented"
+test $((new_extents - (nr * 4 / 10))) -lt $((internal_blks / 2)) || echo "file3 badly fragmented"
 
 # success, all done
 status=0
diff --git a/tests/xfs/231 b/tests/xfs/231
index 60f59a9..166f6b0 100755
--- a/tests/xfs/231
+++ b/tests/xfs/231
@@ -123,7 +123,7 @@ new_extents=$(_count_extents $testdir/file2)
 echo "old extents: $old_extents" >> $seqres.full
 echo "new extents: $new_extents" >> $seqres.full
 echo "maximum extents: $internal_blks" >> $seqres.full
-test $new_extents -lt $((internal_blks / 7)) || echo "file2 badly fragmented"
+test $new_extents -le $((3 * nr / bufnr)) || echo "file2 more fragmented than expected"
 
 # success, all done
 status=0
diff --git a/tests/xfs/232 b/tests/xfs/232
index 9a8403c..0008dbf 100755
--- a/tests/xfs/232
+++ b/tests/xfs/232
@@ -125,7 +125,7 @@ new_extents=$(_count_extents $testdir/file2)
 echo "old extents: $old_extents" >> $seqres.full
 echo "new extents: $new_extents" >> $seqres.full
 echo "maximum extents: $internal_blks" >> $seqres.full
-test $new_extents -lt $((internal_blks / 12)) || echo "file2 not sufficiently fragmented"
+test $new_extents -le $((2 * nr / bufnr)) || echo "file2 more fragmented than expected"
 
 # success, all done
 status=0


^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH 03/12] reflink: fix fragmentation tests to work on >4k block size filesystems
@ 2016-03-05  0:37   ` Darrick J. Wong
  0 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:37 UTC (permalink / raw)
  To: david, darrick.wong; +Cc: linux-ext4, fstests, linux-btrfs, xfs

For tests that only overwrite part of a file, only consider the number
of extents in the *rewritten* blocks when deciding if the FS
fragmentation performance is satisfactory.

(Also slip in a fix for xfs/127 so that it formats correctly when we
specify big blocksizes via MKFS_OPTIONS.)

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/127 |    2 +-
 tests/xfs/215 |    2 +-
 tests/xfs/218 |    2 +-
 tests/xfs/219 |    2 +-
 tests/xfs/221 |    2 +-
 tests/xfs/223 |    2 +-
 tests/xfs/224 |    2 +-
 tests/xfs/225 |    2 +-
 tests/xfs/226 |    2 +-
 tests/xfs/228 |    2 +-
 tests/xfs/230 |    2 +-
 tests/xfs/231 |    2 +-
 tests/xfs/232 |    2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)


diff --git a/tests/xfs/127 b/tests/xfs/127
index f44daae..6b768c9 100755
--- a/tests/xfs/127
+++ b/tests/xfs/127
@@ -48,7 +48,7 @@ _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_mkfs_sized $((2 * 4096 * 4096)) > $seqres.full 2>&1
 _scratch_mount >> $seqres.full 2>&1
 
 testdir=$SCRATCH_MNT/test-$seq
diff --git a/tests/xfs/215 b/tests/xfs/215
index 5ae4d85..7a517d7 100755
--- a/tests/xfs/215
+++ b/tests/xfs/215
@@ -95,7 +95,7 @@ new_extents=$(_count_extents $testdir/file3)
 echo "old extents: $old_extents" >> $seqres.full
 echo "new extents: $new_extents" >> $seqres.full
 echo "maximum extents: $internal_blks" >> $seqres.full
-test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented"
+test $((new_extents - (nr / 2))) -lt $((internal_blks / 2)) || echo "file3 badly fragmented"
 
 # success, all done
 status=0
diff --git a/tests/xfs/218 b/tests/xfs/218
index ea464f2..0ab4102 100755
--- a/tests/xfs/218
+++ b/tests/xfs/218
@@ -94,7 +94,7 @@ new_extents=$(_count_extents $testdir/file3)
 echo "old extents: $old_extents" >> $seqres.full
 echo "new extents: $new_extents" >> $seqres.full
 echo "maximum extents: $internal_blks" >> $seqres.full
-test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented"
+test $((new_extents - (nr / 2))) -lt $((internal_blks / 2)) || echo "file3 badly fragmented"
 
 # success, all done
 status=0
diff --git a/tests/xfs/219 b/tests/xfs/219
index 012b07c..df57e07 100755
--- a/tests/xfs/219
+++ b/tests/xfs/219
@@ -95,7 +95,7 @@ new_extents=$(_count_extents $testdir/file3)
 echo "old extents: $old_extents" >> $seqres.full
 echo "new extents: $new_extents" >> $seqres.full
 echo "maximum extents: $internal_blks" >> $seqres.full
-test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented"
+test $((new_extents - (nr / 4))) -lt $((internal_blks / 2)) || echo "file3 badly fragmented"
 
 # success, all done
 status=0
diff --git a/tests/xfs/221 b/tests/xfs/221
index 8b860f2..03d81ac 100755
--- a/tests/xfs/221
+++ b/tests/xfs/221
@@ -94,7 +94,7 @@ new_extents=$(_count_extents $testdir/file3)
 echo "old extents: $old_extents" >> $seqres.full
 echo "new extents: $new_extents" >> $seqres.full
 echo "maximum extents: $internal_blks" >> $seqres.full
-test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented"
+test $((new_extents - (nr / 4))) -lt $((internal_blks / 2)) || echo "file3 badly fragmented"
 
 # success, all done
 status=0
diff --git a/tests/xfs/223 b/tests/xfs/223
index 1e6ba98..7c990a2 100755
--- a/tests/xfs/223
+++ b/tests/xfs/223
@@ -97,7 +97,7 @@ new_extents=$(_count_extents $testdir/file3)
 echo "old extents: $old_extents" >> $seqres.full
 echo "new extents: $new_extents" >> $seqres.full
 echo "maximum extents: $internal_blks" >> $seqres.full
-test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented"
+test $((new_extents - (nr / 2))) -lt $((internal_blks / 2)) || echo "file3 badly fragmented"
 
 # success, all done
 status=0
diff --git a/tests/xfs/224 b/tests/xfs/224
index 3d19f94..bf33d1f 100755
--- a/tests/xfs/224
+++ b/tests/xfs/224
@@ -96,7 +96,7 @@ new_extents=$(_count_extents $testdir/file3)
 echo "old extents: $old_extents" >> $seqres.full
 echo "new extents: $new_extents" >> $seqres.full
 echo "maximum extents: $internal_blks" >> $seqres.full
-test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented"
+test $((new_extents - (nr / 2))) -lt $((internal_blks / 2)) || echo "file3 badly fragmented"
 
 # success, all done
 status=0
diff --git a/tests/xfs/225 b/tests/xfs/225
index c2e5b82..749816f 100755
--- a/tests/xfs/225
+++ b/tests/xfs/225
@@ -95,7 +95,7 @@ new_extents=$(_count_extents $testdir/file3)
 echo "old extents: $old_extents" >> $seqres.full
 echo "new extents: $new_extents" >> $seqres.full
 echo "maximum extents: $internal_blks" >> $seqres.full
-test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented"
+test $((new_extents - (nr / 2))) -lt $((internal_blks / 2)) || echo "file3 badly fragmented"
 
 # success, all done
 status=0
diff --git a/tests/xfs/226 b/tests/xfs/226
index 3f035b4..bb94d24 100755
--- a/tests/xfs/226
+++ b/tests/xfs/226
@@ -94,7 +94,7 @@ new_extents=$(_count_extents $testdir/file3)
 echo "old extents: $old_extents" >> $seqres.full
 echo "new extents: $new_extents" >> $seqres.full
 echo "maximum extents: $internal_blks" >> $seqres.full
-test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented"
+test $((new_extents - (nr / 2))) -lt $((internal_blks / 2)) || echo "file3 badly fragmented"
 
 # success, all done
 status=0
diff --git a/tests/xfs/228 b/tests/xfs/228
index 52fbb75..df1fd7a 100755
--- a/tests/xfs/228
+++ b/tests/xfs/228
@@ -103,7 +103,7 @@ new_extents=$(_count_extents $testdir/file3)
 echo "old extents: $old_extents" >> $seqres.full
 echo "new extents: $new_extents" >> $seqres.full
 echo "maximum extents: $internal_blks" >> $seqres.full
-test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented"
+test $((new_extents - (nr * 4 / 10))) -lt $((internal_blks / 2)) || echo "file3 badly fragmented"
 
 # success, all done
 status=0
diff --git a/tests/xfs/230 b/tests/xfs/230
index 91e4d3f..73f599a 100755
--- a/tests/xfs/230
+++ b/tests/xfs/230
@@ -103,7 +103,7 @@ new_extents=$(_count_extents $testdir/file3)
 echo "old extents: $old_extents" >> $seqres.full
 echo "new extents: $new_extents" >> $seqres.full
 echo "maximum extents: $internal_blks" >> $seqres.full
-test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented"
+test $((new_extents - (nr * 4 / 10))) -lt $((internal_blks / 2)) || echo "file3 badly fragmented"
 
 # success, all done
 status=0
diff --git a/tests/xfs/231 b/tests/xfs/231
index 60f59a9..166f6b0 100755
--- a/tests/xfs/231
+++ b/tests/xfs/231
@@ -123,7 +123,7 @@ new_extents=$(_count_extents $testdir/file2)
 echo "old extents: $old_extents" >> $seqres.full
 echo "new extents: $new_extents" >> $seqres.full
 echo "maximum extents: $internal_blks" >> $seqres.full
-test $new_extents -lt $((internal_blks / 7)) || echo "file2 badly fragmented"
+test $new_extents -le $((3 * nr / bufnr)) || echo "file2 more fragmented than expected"
 
 # success, all done
 status=0
diff --git a/tests/xfs/232 b/tests/xfs/232
index 9a8403c..0008dbf 100755
--- a/tests/xfs/232
+++ b/tests/xfs/232
@@ -125,7 +125,7 @@ new_extents=$(_count_extents $testdir/file2)
 echo "old extents: $old_extents" >> $seqres.full
 echo "new extents: $new_extents" >> $seqres.full
 echo "maximum extents: $internal_blks" >> $seqres.full
-test $new_extents -lt $((internal_blks / 12)) || echo "file2 not sufficiently fragmented"
+test $new_extents -le $((2 * nr / bufnr)) || echo "file2 more fragmented than expected"
 
 # success, all done
 status=0

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH 04/12] xfs/23[3-6]: don't source common/xfs, it doesn't exist
  2016-03-05  0:37 ` Darrick J. Wong
@ 2016-03-05  0:37   ` Darrick J. Wong
  -1 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:37 UTC (permalink / raw)
  To: david, darrick.wong; +Cc: linux-ext4, linux-btrfs, fstests, xfs

Don't source common/xfs, since it doesn't (yet) exist.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/233 |    1 -
 tests/xfs/234 |    1 -
 tests/xfs/235 |    1 -
 tests/xfs/236 |    1 -
 4 files changed, 4 deletions(-)


diff --git a/tests/xfs/233 b/tests/xfs/233
index f10af2b..8fcf766 100755
--- a/tests/xfs/233
+++ b/tests/xfs/233
@@ -39,7 +39,6 @@ _cleanup()
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
-. ./common/xfs
 
 # real QA test starts here
 _supported_os Linux
diff --git a/tests/xfs/234 b/tests/xfs/234
index 649cb7e..2bbf295 100755
--- a/tests/xfs/234
+++ b/tests/xfs/234
@@ -41,7 +41,6 @@ _cleanup()
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
-. ./common/xfs
 
 # real QA test starts here
 _supported_os Linux
diff --git a/tests/xfs/235 b/tests/xfs/235
index 5af72a6..370131b 100755
--- a/tests/xfs/235
+++ b/tests/xfs/235
@@ -41,7 +41,6 @@ _cleanup()
 . ./common/rc
 . ./common/filter
 . ./common/attr
-. ./common/xfs
 
 # real QA test starts here
 _supported_os Linux
diff --git a/tests/xfs/236 b/tests/xfs/236
index 99e9a75..c7b3a19 100755
--- a/tests/xfs/236
+++ b/tests/xfs/236
@@ -41,7 +41,6 @@ _cleanup()
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
-. ./common/xfs
 
 # real QA test starts here
 _supported_os Linux


^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH 04/12] xfs/23[3-6]: don't source common/xfs, it doesn't exist
@ 2016-03-05  0:37   ` Darrick J. Wong
  0 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:37 UTC (permalink / raw)
  To: david, darrick.wong; +Cc: linux-ext4, fstests, linux-btrfs, xfs

Don't source common/xfs, since it doesn't (yet) exist.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/233 |    1 -
 tests/xfs/234 |    1 -
 tests/xfs/235 |    1 -
 tests/xfs/236 |    1 -
 4 files changed, 4 deletions(-)


diff --git a/tests/xfs/233 b/tests/xfs/233
index f10af2b..8fcf766 100755
--- a/tests/xfs/233
+++ b/tests/xfs/233
@@ -39,7 +39,6 @@ _cleanup()
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
-. ./common/xfs
 
 # real QA test starts here
 _supported_os Linux
diff --git a/tests/xfs/234 b/tests/xfs/234
index 649cb7e..2bbf295 100755
--- a/tests/xfs/234
+++ b/tests/xfs/234
@@ -41,7 +41,6 @@ _cleanup()
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
-. ./common/xfs
 
 # real QA test starts here
 _supported_os Linux
diff --git a/tests/xfs/235 b/tests/xfs/235
index 5af72a6..370131b 100755
--- a/tests/xfs/235
+++ b/tests/xfs/235
@@ -41,7 +41,6 @@ _cleanup()
 . ./common/rc
 . ./common/filter
 . ./common/attr
-. ./common/xfs
 
 # real QA test starts here
 _supported_os Linux
diff --git a/tests/xfs/236 b/tests/xfs/236
index 99e9a75..c7b3a19 100755
--- a/tests/xfs/236
+++ b/tests/xfs/236
@@ -41,7 +41,6 @@ _cleanup()
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
-. ./common/xfs
 
 # real QA test starts here
 _supported_os Linux

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH 05/12] xfs/206: fix output when mkfs knows about reflink
  2016-03-05  0:37 ` Darrick J. Wong
@ 2016-03-05  0:37   ` Darrick J. Wong
  -1 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:37 UTC (permalink / raw)
  To: david, darrick.wong; +Cc: linux-ext4, linux-btrfs, fstests, xfs

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/206     |    1 +
 tests/xfs/206.out |    2 ++
 2 files changed, 3 insertions(+)


diff --git a/tests/xfs/206 b/tests/xfs/206
index 0f5d97d..24e690a 100755
--- a/tests/xfs/206
+++ b/tests/xfs/206
@@ -80,6 +80,7 @@ mkfs_filter()
 	    -e "s/\(^log.*blocks=\)\([0-9]*,\)/\1XXXXX,/" \
 	    -e "s/, projid32bit=[0-9]//" \
 	    -e "s/ ftype=[0-9]//" \
+	    -e "s/ reflink=[0-9]//" \
 	    -e "s/\(sectsz\)\(=[0-9]* *\)/\1=512   /" \
 	    -e "s/\(sunit=\)\([0-9]* blks,\)/\10 blks,/" \
 	    -e "s/, lazy-count=[0-9]//" \
diff --git a/tests/xfs/206.out b/tests/xfs/206.out
index 2db839d..e73a954 100644
--- a/tests/xfs/206.out
+++ b/tests/xfs/206.out
@@ -12,6 +12,7 @@ realtime =none                   extsz=4096   blocks=0, rtextents=0
 === xfs_growfs ===
 meta-data=FILE isize=N    agcount=52, agsize=76288719 blks
          =                       sectsz=512   attr=2
+         =                      
 data     =                       bsize=4096   blocks=3905982455, imaxpct=5
          =                       sunit=0      swidth=0 blks
 naming   =version 2              bsize=4096   ascii-ci=0
@@ -22,6 +23,7 @@ data blocks changed from 3905982455 to 4882478016
 === xfs_info ===
 meta-data=FILE isize=N    agcount=64, agsize=76288719 blks
          =                       sectsz=512   attr=2
+         =                      
 data     =                       bsize=4096   blocks=4882478016, imaxpct=5
          =                       sunit=0      swidth=0 blks
 naming   =version 2              bsize=4096   ascii-ci=0


^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH 05/12] xfs/206: fix output when mkfs knows about reflink
@ 2016-03-05  0:37   ` Darrick J. Wong
  0 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:37 UTC (permalink / raw)
  To: david, darrick.wong; +Cc: linux-ext4, fstests, linux-btrfs, xfs

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/206     |    1 +
 tests/xfs/206.out |    2 ++
 2 files changed, 3 insertions(+)


diff --git a/tests/xfs/206 b/tests/xfs/206
index 0f5d97d..24e690a 100755
--- a/tests/xfs/206
+++ b/tests/xfs/206
@@ -80,6 +80,7 @@ mkfs_filter()
 	    -e "s/\(^log.*blocks=\)\([0-9]*,\)/\1XXXXX,/" \
 	    -e "s/, projid32bit=[0-9]//" \
 	    -e "s/ ftype=[0-9]//" \
+	    -e "s/ reflink=[0-9]//" \
 	    -e "s/\(sectsz\)\(=[0-9]* *\)/\1=512   /" \
 	    -e "s/\(sunit=\)\([0-9]* blks,\)/\10 blks,/" \
 	    -e "s/, lazy-count=[0-9]//" \
diff --git a/tests/xfs/206.out b/tests/xfs/206.out
index 2db839d..e73a954 100644
--- a/tests/xfs/206.out
+++ b/tests/xfs/206.out
@@ -12,6 +12,7 @@ realtime =none                   extsz=4096   blocks=0, rtextents=0
 === xfs_growfs ===
 meta-data=FILE isize=N    agcount=52, agsize=76288719 blks
          =                       sectsz=512   attr=2
+         =                      
 data     =                       bsize=4096   blocks=3905982455, imaxpct=5
          =                       sunit=0      swidth=0 blks
 naming   =version 2              bsize=4096   ascii-ci=0
@@ -22,6 +23,7 @@ data blocks changed from 3905982455 to 4882478016
 === xfs_info ===
 meta-data=FILE isize=N    agcount=64, agsize=76288719 blks
          =                       sectsz=512   attr=2
+         =                      
 data     =                       bsize=4096   blocks=4882478016, imaxpct=5
          =                       sunit=0      swidth=0 blks
 naming   =version 2              bsize=4096   ascii-ci=0

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH 06/12] xfs/030: fix output on newer filesystems
  2016-03-05  0:37 ` Darrick J. Wong
@ 2016-03-05  0:37   ` Darrick J. Wong
  -1 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:37 UTC (permalink / raw)
  To: david, darrick.wong; +Cc: linux-ext4, linux-btrfs, fstests, xfs

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/030           |    5 ++++-
 tests/xfs/030.out.linux |    2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)


diff --git a/tests/xfs/030 b/tests/xfs/030
index 4cb1524..33c906c 100755
--- a/tests/xfs/030
+++ b/tests/xfs/030
@@ -57,7 +57,10 @@ _check_ag()
 		echo "Corrupting $structure - setting bits to $1"
 		_check_repair $1 "$structure" |
 			sed -e '/^error following ag 0 unlinked list$/d' \
-			    -e '/^bad agbno AGBNO for finobt/d'
+			    -e '/^bad agbno AGBNO for finobt/d' \
+			    -e '/^bad agbno AGBNO for rmapbt/d' \
+			    -e '/^bad agbno AGBNO for refcntbt/d' \
+			    -e '/^Missing reverse-mapping record.*/d'
 	done
 }
 
diff --git a/tests/xfs/030.out.linux b/tests/xfs/030.out.linux
index cf3259f..14b9b35 100644
--- a/tests/xfs/030.out.linux
+++ b/tests/xfs/030.out.linux
@@ -231,6 +231,8 @@ bad agbno AGBNO in agfl, agno 0
 bad agbno AGBNO in agfl, agno 0
 bad agbno AGBNO in agfl, agno 0
 bad agbno AGBNO in agfl, agno 0
+bad agbno AGBNO in agfl, agno 0
+bad agbno AGBNO in agfl, agno 0
         - found root inode chunk
 Phase 3 - for each AG...
         - scan and clear agi unlinked lists...


^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH 06/12] xfs/030: fix output on newer filesystems
@ 2016-03-05  0:37   ` Darrick J. Wong
  0 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:37 UTC (permalink / raw)
  To: david, darrick.wong; +Cc: linux-ext4, fstests, linux-btrfs, xfs

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/030           |    5 ++++-
 tests/xfs/030.out.linux |    2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)


diff --git a/tests/xfs/030 b/tests/xfs/030
index 4cb1524..33c906c 100755
--- a/tests/xfs/030
+++ b/tests/xfs/030
@@ -57,7 +57,10 @@ _check_ag()
 		echo "Corrupting $structure - setting bits to $1"
 		_check_repair $1 "$structure" |
 			sed -e '/^error following ag 0 unlinked list$/d' \
-			    -e '/^bad agbno AGBNO for finobt/d'
+			    -e '/^bad agbno AGBNO for finobt/d' \
+			    -e '/^bad agbno AGBNO for rmapbt/d' \
+			    -e '/^bad agbno AGBNO for refcntbt/d' \
+			    -e '/^Missing reverse-mapping record.*/d'
 	done
 }
 
diff --git a/tests/xfs/030.out.linux b/tests/xfs/030.out.linux
index cf3259f..14b9b35 100644
--- a/tests/xfs/030.out.linux
+++ b/tests/xfs/030.out.linux
@@ -231,6 +231,8 @@ bad agbno AGBNO in agfl, agno 0
 bad agbno AGBNO in agfl, agno 0
 bad agbno AGBNO in agfl, agno 0
 bad agbno AGBNO in agfl, agno 0
+bad agbno AGBNO in agfl, agno 0
+bad agbno AGBNO in agfl, agno 0
         - found root inode chunk
 Phase 3 - for each AG...
         - scan and clear agi unlinked lists...

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH 07/12] xfs/073: fix output
  2016-03-05  0:37 ` Darrick J. Wong
@ 2016-03-05  0:38   ` Darrick J. Wong
  -1 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:38 UTC (permalink / raw)
  To: david, darrick.wong; +Cc: linux-ext4, linux-btrfs, fstests, xfs

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/073.out |    3 +++
 1 file changed, 3 insertions(+)


diff --git a/tests/xfs/073.out b/tests/xfs/073.out
index 3f27467..fb035cb 100644
--- a/tests/xfs/073.out
+++ b/tests/xfs/073.out
@@ -1,4 +1,7 @@
 QA output created by 073
+warning: finobt not supported without CRC support, disabled.
+warning: rmapbt not supported without CRC support, disabled.
+warning: reflink not supported without CRC support, disabled.
 meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
 data     = bsize=XXX blocks=XXX, imaxpct=PCT
          = sunit=XXX swidth=XXX, unwritten=X


^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH 07/12] xfs/073: fix output
@ 2016-03-05  0:38   ` Darrick J. Wong
  0 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:38 UTC (permalink / raw)
  To: david, darrick.wong; +Cc: linux-ext4, fstests, linux-btrfs, xfs

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/073.out |    3 +++
 1 file changed, 3 insertions(+)


diff --git a/tests/xfs/073.out b/tests/xfs/073.out
index 3f27467..fb035cb 100644
--- a/tests/xfs/073.out
+++ b/tests/xfs/073.out
@@ -1,4 +1,7 @@
 QA output created by 073
+warning: finobt not supported without CRC support, disabled.
+warning: rmapbt not supported without CRC support, disabled.
+warning: reflink not supported without CRC support, disabled.
 meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
 data     = bsize=XXX blocks=XXX, imaxpct=PCT
          = sunit=XXX swidth=XXX, unwritten=X

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH 08/12] xfs/122: define _GNU_SOURCE when compiling test program
  2016-03-05  0:37 ` Darrick J. Wong
@ 2016-03-05  0:38   ` Darrick J. Wong
  -1 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:38 UTC (permalink / raw)
  To: david, darrick.wong; +Cc: linux-ext4, linux-btrfs, fstests, xfs

This makes it so we don't get warnings about off64_t not being
defined when compiling the test program.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/122 |    1 +
 1 file changed, 1 insertion(+)


diff --git a/tests/xfs/122 b/tests/xfs/122
index 758cb50..dc28c56 100755
--- a/tests/xfs/122
+++ b/tests/xfs/122
@@ -73,6 +73,7 @@ oprog=$tmp.get_structs
 progout=$tmp.output
 
 cat >$cprog <<EOF
+#define _GNU_SOURCE
 #include <stdio.h>
 EOF
 for hdr in /usr/include/xfs/xfs*.h; do


^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH 08/12] xfs/122: define _GNU_SOURCE when compiling test program
@ 2016-03-05  0:38   ` Darrick J. Wong
  0 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:38 UTC (permalink / raw)
  To: david, darrick.wong; +Cc: linux-ext4, fstests, linux-btrfs, xfs

This makes it so we don't get warnings about off64_t not being
defined when compiling the test program.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/122 |    1 +
 1 file changed, 1 insertion(+)


diff --git a/tests/xfs/122 b/tests/xfs/122
index 758cb50..dc28c56 100755
--- a/tests/xfs/122
+++ b/tests/xfs/122
@@ -73,6 +73,7 @@ oprog=$tmp.get_structs
 progout=$tmp.output
 
 cat >$cprog <<EOF
+#define _GNU_SOURCE
 #include <stdio.h>
 EOF
 for hdr in /usr/include/xfs/xfs*.h; do

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH 09/12] xfs/122: support rmapxbt
  2016-03-05  0:37 ` Darrick J. Wong
@ 2016-03-05  0:38   ` Darrick J. Wong
  -1 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:38 UTC (permalink / raw)
  To: david, darrick.wong; +Cc: linux-ext4, linux-btrfs, fstests, xfs

Support the extended rmap btree key structure.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/122.out |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


diff --git a/tests/xfs/122.out b/tests/xfs/122.out
index c590166..451871e 100644
--- a/tests/xfs/122.out
+++ b/tests/xfs/122.out
@@ -77,8 +77,9 @@ sizeof(struct xfs_fs_eofblocks) = 128
 sizeof(struct xfs_icreate_log) = 28
 sizeof(struct xfs_refcount_key) = 4
 sizeof(struct xfs_refcount_rec) = 12
-sizeof(struct xfs_rmap_key) = 20
+sizeof(struct xfs_rmap_key) = 4
 sizeof(struct xfs_rmap_rec) = 24
+sizeof(struct xfs_rmapx_key) = 20
 sizeof(xfs_agf_t) = 224
 sizeof(xfs_agfl_t) = 36
 sizeof(xfs_agi_t) = 336


^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH 09/12] xfs/122: support rmapxbt
@ 2016-03-05  0:38   ` Darrick J. Wong
  0 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:38 UTC (permalink / raw)
  To: david, darrick.wong; +Cc: linux-ext4, fstests, linux-btrfs, xfs

Support the extended rmap btree key structure.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/122.out |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


diff --git a/tests/xfs/122.out b/tests/xfs/122.out
index c590166..451871e 100644
--- a/tests/xfs/122.out
+++ b/tests/xfs/122.out
@@ -77,8 +77,9 @@ sizeof(struct xfs_fs_eofblocks) = 128
 sizeof(struct xfs_icreate_log) = 28
 sizeof(struct xfs_refcount_key) = 4
 sizeof(struct xfs_refcount_rec) = 12
-sizeof(struct xfs_rmap_key) = 20
+sizeof(struct xfs_rmap_key) = 4
 sizeof(struct xfs_rmap_rec) = 24
+sizeof(struct xfs_rmapx_key) = 20
 sizeof(xfs_agf_t) = 224
 sizeof(xfs_agfl_t) = 36
 sizeof(xfs_agi_t) = 336

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH 10/12] xfs: test per-ag allocation accounting during truncate-caused refcountbt expansion
  2016-03-05  0:37 ` Darrick J. Wong
@ 2016-03-05  0:38   ` Darrick J. Wong
  -1 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:38 UTC (permalink / raw)
  To: david, darrick.wong
  Cc: linux-btrfs, linux-ext4, Christoph Hellwig, fstests, xfs

Ensure that refcountbt allocations during truncate operations come
from the per-AG reservation and are not charged to the transaction.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/855     |   95 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/xfs/855.out |   10 ++++++
 tests/xfs/group   |    1 +
 3 files changed, 106 insertions(+)
 create mode 100755 tests/xfs/855
 create mode 100644 tests/xfs/855.out


diff --git a/tests/xfs/855 b/tests/xfs/855
new file mode 100755
index 0000000..93bd286
--- /dev/null
+++ b/tests/xfs/855
@@ -0,0 +1,95 @@
+#! /bin/bash
+# FS QA Test No. 855
+#
+# Ensure that we can create enough distinct reflink entries to force creation
+# of a multi-level refcount btree by reflinking a file a number of times and
+# truncating the copies at successively lower sizes.  Delete and recreate a few
+# times to exercise the refcount btree grow/shrink functions.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016, 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 /
+    umount $SCRATCH_MNT > /dev/null 2>&1
+    rm -rf $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
+
+rm -f $seqres.full
+
+_scratch_mkfs >/dev/null 2>&1
+_scratch_mount
+
+testdir=$SCRATCH_MNT/test-$seq
+mkdir $testdir
+
+echo "Create the original file blocks"
+blksz="$(stat -f $testdir -c '%S')"
+nr_blks=$((2 * blksz / 12))
+
+for i in 1 2 x; do
+	_pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/file1 >> $seqres.full
+
+	echo "$i: Reflink a bunch of times"
+	seq 1 $nr_blks | while read nr; do
+		_cp_reflink $testdir/file1 $testdir/file1.$nr >> $seqres.full
+	done
+	sync
+
+	echo "$i: Truncate files"
+	seq 1 $nr_blks | while read nr; do
+		truncate -s $((blksz * (nr_blks - nr))) $testdir/file1.$nr >> $seqres.full
+	done
+
+	umount $SCRATCH_MNT
+	_check_scratch_fs
+	_scratch_mount
+
+	test $i = "x" && break
+
+	echo "$i: Delete both files"
+	rm -rf $testdir
+	mkdir -p $testdir
+	umount $SCRATCH_MNT
+	_check_scratch_fs
+	_scratch_mount
+done
+
+# success, all done
+status=0
+exit
diff --git a/tests/xfs/855.out b/tests/xfs/855.out
new file mode 100644
index 0000000..d196352
--- /dev/null
+++ b/tests/xfs/855.out
@@ -0,0 +1,10 @@
+QA output created by 855
+Create the original file blocks
+1: Reflink a bunch of times
+1: Truncate files
+1: Delete both files
+2: Reflink a bunch of times
+2: Truncate files
+2: Delete both files
+x: Reflink a bunch of times
+x: Truncate files
diff --git a/tests/xfs/group b/tests/xfs/group
index 50353f1..70f422e 100644
--- a/tests/xfs/group
+++ b/tests/xfs/group
@@ -286,3 +286,4 @@
 305 auto quota
 853 auto quick clone
 854 auto quick clone
+855 auto clone


^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH 10/12] xfs: test per-ag allocation accounting during truncate-caused refcountbt expansion
@ 2016-03-05  0:38   ` Darrick J. Wong
  0 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:38 UTC (permalink / raw)
  To: david, darrick.wong
  Cc: fstests, linux-ext4, Christoph Hellwig, linux-btrfs, xfs

Ensure that refcountbt allocations during truncate operations come
from the per-AG reservation and are not charged to the transaction.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/855     |   95 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/xfs/855.out |   10 ++++++
 tests/xfs/group   |    1 +
 3 files changed, 106 insertions(+)
 create mode 100755 tests/xfs/855
 create mode 100644 tests/xfs/855.out


diff --git a/tests/xfs/855 b/tests/xfs/855
new file mode 100755
index 0000000..93bd286
--- /dev/null
+++ b/tests/xfs/855
@@ -0,0 +1,95 @@
+#! /bin/bash
+# FS QA Test No. 855
+#
+# Ensure that we can create enough distinct reflink entries to force creation
+# of a multi-level refcount btree by reflinking a file a number of times and
+# truncating the copies at successively lower sizes.  Delete and recreate a few
+# times to exercise the refcount btree grow/shrink functions.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016, 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 /
+    umount $SCRATCH_MNT > /dev/null 2>&1
+    rm -rf $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
+
+rm -f $seqres.full
+
+_scratch_mkfs >/dev/null 2>&1
+_scratch_mount
+
+testdir=$SCRATCH_MNT/test-$seq
+mkdir $testdir
+
+echo "Create the original file blocks"
+blksz="$(stat -f $testdir -c '%S')"
+nr_blks=$((2 * blksz / 12))
+
+for i in 1 2 x; do
+	_pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/file1 >> $seqres.full
+
+	echo "$i: Reflink a bunch of times"
+	seq 1 $nr_blks | while read nr; do
+		_cp_reflink $testdir/file1 $testdir/file1.$nr >> $seqres.full
+	done
+	sync
+
+	echo "$i: Truncate files"
+	seq 1 $nr_blks | while read nr; do
+		truncate -s $((blksz * (nr_blks - nr))) $testdir/file1.$nr >> $seqres.full
+	done
+
+	umount $SCRATCH_MNT
+	_check_scratch_fs
+	_scratch_mount
+
+	test $i = "x" && break
+
+	echo "$i: Delete both files"
+	rm -rf $testdir
+	mkdir -p $testdir
+	umount $SCRATCH_MNT
+	_check_scratch_fs
+	_scratch_mount
+done
+
+# success, all done
+status=0
+exit
diff --git a/tests/xfs/855.out b/tests/xfs/855.out
new file mode 100644
index 0000000..d196352
--- /dev/null
+++ b/tests/xfs/855.out
@@ -0,0 +1,10 @@
+QA output created by 855
+Create the original file blocks
+1: Reflink a bunch of times
+1: Truncate files
+1: Delete both files
+2: Reflink a bunch of times
+2: Truncate files
+2: Delete both files
+x: Reflink a bunch of times
+x: Truncate files
diff --git a/tests/xfs/group b/tests/xfs/group
index 50353f1..70f422e 100644
--- a/tests/xfs/group
+++ b/tests/xfs/group
@@ -286,3 +286,4 @@
 305 auto quota
 853 auto quick clone
 854 auto quick clone
+855 auto clone

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH 11/12] xfs: remove NOCOW_FL testing from test
  2016-03-05  0:37 ` Darrick J. Wong
@ 2016-03-05  0:38   ` Darrick J. Wong
  -1 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:38 UTC (permalink / raw)
  To: david, darrick.wong; +Cc: linux-ext4, linux-btrfs, fstests, xfs

Since XFS dropped support for the NOCOW_FL flag, cut it out of the tests.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/132     |    5 -----
 tests/xfs/132.out |   20 --------------------
 2 files changed, 25 deletions(-)


diff --git a/tests/xfs/132 b/tests/xfs/132
index f174b3f..b09ccb6 100755
--- a/tests/xfs/132
+++ b/tests/xfs/132
@@ -88,32 +88,27 @@ for i in `seq 2 $nr`; do
 done
 _test_cycle_mount
 free_blocks1=$(stat -f $testdir -c '%f')
-lsattr -l $testdir/ | _filter_test_dir | _filter_spaces
 
 echo "funshare part of a file"
 $XFS_IO_PROG -f -c "falloc 0 $((sz / 2))" $testdir/file2
 _test_cycle_mount
-lsattr -l $testdir/ | _filter_test_dir | _filter_spaces
 
 echo "funshare some of the copies"
 $XFS_IO_PROG -f -c "falloc 0 $sz" $testdir/file2
 $XFS_IO_PROG -f -c "falloc 0 $sz" $testdir/file3
 _test_cycle_mount
 free_blocks2=$(stat -f $testdir -c '%f')
-lsattr -l $testdir/ | _filter_test_dir | _filter_spaces
 
 echo "funshare the rest of the files"
 $XFS_IO_PROG -f -c "falloc 0 $sz" $testdir/file4
 $XFS_IO_PROG -f -c "falloc 0 $sz" $testdir/file1
 _test_cycle_mount
 free_blocks3=$(stat -f $testdir -c '%f')
-lsattr -l $testdir/ | _filter_test_dir | _filter_spaces
 
 echo "Rewrite the original file"
 _pwrite_byte 0x65 0 $sz $testdir/file1 >> $seqres.full
 _test_cycle_mount
 free_blocks4=$(stat -f $testdir -c '%f')
-lsattr -l $testdir/ | _filter_test_dir | _filter_spaces
 #echo $free_blocks0 $free_blocks1 $free_blocks2 $free_blocks3 $free_blocks4
 
 _within_tolerance "free blocks after reflinking" $free_blocks1 $((free_blocks0 - blks)) $margin -v
diff --git a/tests/xfs/132.out b/tests/xfs/132.out
index f32db7d..3d1281c 100644
--- a/tests/xfs/132.out
+++ b/tests/xfs/132.out
@@ -1,30 +1,10 @@
 QA output created by 132
 Create the original file blocks
 Create the reflink copies
-TEST_DIR/test-132/file1 ---
-TEST_DIR/test-132/file2 ---
-TEST_DIR/test-132/file3 ---
-TEST_DIR/test-132/file4 ---
 funshare part of a file
-TEST_DIR/test-132/file1 ---
-TEST_DIR/test-132/file2 ---
-TEST_DIR/test-132/file3 ---
-TEST_DIR/test-132/file4 ---
 funshare some of the copies
-TEST_DIR/test-132/file1 ---
-TEST_DIR/test-132/file2 No_COW
-TEST_DIR/test-132/file3 No_COW
-TEST_DIR/test-132/file4 ---
 funshare the rest of the files
-TEST_DIR/test-132/file1 No_COW
-TEST_DIR/test-132/file2 No_COW
-TEST_DIR/test-132/file3 No_COW
-TEST_DIR/test-132/file4 No_COW
 Rewrite the original file
-TEST_DIR/test-132/file1 No_COW
-TEST_DIR/test-132/file2 No_COW
-TEST_DIR/test-132/file3 No_COW
-TEST_DIR/test-132/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


^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH 11/12] xfs: remove NOCOW_FL testing from test
@ 2016-03-05  0:38   ` Darrick J. Wong
  0 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:38 UTC (permalink / raw)
  To: david, darrick.wong; +Cc: linux-ext4, fstests, linux-btrfs, xfs

Since XFS dropped support for the NOCOW_FL flag, cut it out of the tests.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/132     |    5 -----
 tests/xfs/132.out |   20 --------------------
 2 files changed, 25 deletions(-)


diff --git a/tests/xfs/132 b/tests/xfs/132
index f174b3f..b09ccb6 100755
--- a/tests/xfs/132
+++ b/tests/xfs/132
@@ -88,32 +88,27 @@ for i in `seq 2 $nr`; do
 done
 _test_cycle_mount
 free_blocks1=$(stat -f $testdir -c '%f')
-lsattr -l $testdir/ | _filter_test_dir | _filter_spaces
 
 echo "funshare part of a file"
 $XFS_IO_PROG -f -c "falloc 0 $((sz / 2))" $testdir/file2
 _test_cycle_mount
-lsattr -l $testdir/ | _filter_test_dir | _filter_spaces
 
 echo "funshare some of the copies"
 $XFS_IO_PROG -f -c "falloc 0 $sz" $testdir/file2
 $XFS_IO_PROG -f -c "falloc 0 $sz" $testdir/file3
 _test_cycle_mount
 free_blocks2=$(stat -f $testdir -c '%f')
-lsattr -l $testdir/ | _filter_test_dir | _filter_spaces
 
 echo "funshare the rest of the files"
 $XFS_IO_PROG -f -c "falloc 0 $sz" $testdir/file4
 $XFS_IO_PROG -f -c "falloc 0 $sz" $testdir/file1
 _test_cycle_mount
 free_blocks3=$(stat -f $testdir -c '%f')
-lsattr -l $testdir/ | _filter_test_dir | _filter_spaces
 
 echo "Rewrite the original file"
 _pwrite_byte 0x65 0 $sz $testdir/file1 >> $seqres.full
 _test_cycle_mount
 free_blocks4=$(stat -f $testdir -c '%f')
-lsattr -l $testdir/ | _filter_test_dir | _filter_spaces
 #echo $free_blocks0 $free_blocks1 $free_blocks2 $free_blocks3 $free_blocks4
 
 _within_tolerance "free blocks after reflinking" $free_blocks1 $((free_blocks0 - blks)) $margin -v
diff --git a/tests/xfs/132.out b/tests/xfs/132.out
index f32db7d..3d1281c 100644
--- a/tests/xfs/132.out
+++ b/tests/xfs/132.out
@@ -1,30 +1,10 @@
 QA output created by 132
 Create the original file blocks
 Create the reflink copies
-TEST_DIR/test-132/file1 ---
-TEST_DIR/test-132/file2 ---
-TEST_DIR/test-132/file3 ---
-TEST_DIR/test-132/file4 ---
 funshare part of a file
-TEST_DIR/test-132/file1 ---
-TEST_DIR/test-132/file2 ---
-TEST_DIR/test-132/file3 ---
-TEST_DIR/test-132/file4 ---
 funshare some of the copies
-TEST_DIR/test-132/file1 ---
-TEST_DIR/test-132/file2 No_COW
-TEST_DIR/test-132/file3 No_COW
-TEST_DIR/test-132/file4 ---
 funshare the rest of the files
-TEST_DIR/test-132/file1 No_COW
-TEST_DIR/test-132/file2 No_COW
-TEST_DIR/test-132/file3 No_COW
-TEST_DIR/test-132/file4 No_COW
 Rewrite the original file
-TEST_DIR/test-132/file1 No_COW
-TEST_DIR/test-132/file2 No_COW
-TEST_DIR/test-132/file3 No_COW
-TEST_DIR/test-132/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

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH 12/12] block: test fallocate for block devices
  2016-03-05  0:37 ` Darrick J. Wong
@ 2016-03-05  0:38   ` Darrick J. Wong
  -1 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:38 UTC (permalink / raw)
  To: david, darrick.wong; +Cc: linux-ext4, linux-btrfs, fstests, xfs

Now that we're wiring up fallocate's PUNCH_HOLE and ZERO_RANGE
features for block devices, add some tests to make sure they
work correctly.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 common/scsi_debug     |    6 ++-
 tests/generic/705     |   65 ++++++++++++++++++++++++++++
 tests/generic/705.out |    6 +++
 tests/generic/706     |   65 ++++++++++++++++++++++++++++
 tests/generic/706.out |    6 +++
 tests/generic/707     |  112 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/707.out |   28 ++++++++++++
 tests/generic/group   |    3 +
 8 files changed, 290 insertions(+), 1 deletion(-)
 create mode 100755 tests/generic/705
 create mode 100644 tests/generic/705.out
 create mode 100755 tests/generic/706
 create mode 100644 tests/generic/706.out
 create mode 100755 tests/generic/707
 create mode 100644 tests/generic/707.out


diff --git a/common/scsi_debug b/common/scsi_debug
index eb08126..74c3802 100644
--- a/common/scsi_debug
+++ b/common/scsi_debug
@@ -40,13 +40,17 @@ _get_scsi_debug_dev()
 	logical=${2-512}
 	unaligned=${3-0}
 	size=${4-128}
+	test -n "$4" && shift
+	test -n "$3" && shift
+	test -n "$2" && shift
+	test -n "$1" && shift
 
 	phys_exp=0
 	while [ $logical -lt $physical ]; do
 		let physical=physical/2
 		let phys_exp=phys_exp+1
 	done
-	opts="sector_size=$logical physblk_exp=$phys_exp lowest_aligned=$unaligned dev_size_mb=$size"
+	opts="sector_size=$logical physblk_exp=$phys_exp lowest_aligned=$unaligned dev_size_mb=$size $@"
 	echo "scsi_debug options $opts" >> $seqres.full
 	modprobe scsi_debug $opts
 	[ $? -eq 0 ] || _fail "scsi_debug modprobe failed"
diff --git a/tests/generic/705 b/tests/generic/705
new file mode 100755
index 0000000..25872ac
--- /dev/null
+++ b/tests/generic/705
@@ -0,0 +1,65 @@
+#! /bin/bash
+# FS QA Test No. 705
+#
+# Test fallocate(ZERO_RANGE) on a block device, which should be able to
+# WRITE SAME (or equivalent) the range.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016 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.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/scsi_debug
+
+# real QA test starts here
+_supported_os Linux
+_require_scsi_debug
+_require_xfs_io_command "fzero"
+
+echo "Create and format"
+dev=$(_get_scsi_debug_dev 512 512 0 4 "lbpws=1 lbpws10=1")
+_pwrite_byte 0x62 0 4m $dev >> $seqres.full
+
+echo "Zero range"
+$XFS_IO_PROG -c "fzero -k 512k 1m" $dev
+
+echo "Check contents"
+md5sum $dev | sed -e "s|$dev|SCSI_DEBUG_DEV|g"
+
+echo "Destroy device"
+_put_scsi_debug_dev
+
+# success, all done
+status=0
+exit
diff --git a/tests/generic/705.out b/tests/generic/705.out
new file mode 100644
index 0000000..7e58a07
--- /dev/null
+++ b/tests/generic/705.out
@@ -0,0 +1,6 @@
+QA output created by 705
+Create and format
+Zero range
+Check contents
+caa26edd6c70ce862eb7ec6f10b138a8  SCSI_DEBUG_DEV
+Destroy device
diff --git a/tests/generic/706 b/tests/generic/706
new file mode 100755
index 0000000..432b800
--- /dev/null
+++ b/tests/generic/706
@@ -0,0 +1,65 @@
+#! /bin/bash
+# FS QA Test No. 706
+#
+# Test fallocate(PUNCH_HOLE) on a block device, which should be able to
+# zero-TRIM (or equivalent) the range.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016 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.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/scsi_debug
+
+# real QA test starts here
+_supported_os Linux
+_require_scsi_debug
+_require_xfs_io_command "fpunch"
+
+echo "Create and format"
+dev=$(_get_scsi_debug_dev 512 512 0 4 "lbpws=1 lbpws10=1")
+_pwrite_byte 0x62 0 4m $dev >> $seqres.full
+
+echo "Zero punch"
+$XFS_IO_PROG -c "fpunch 512k 1m" $dev
+
+echo "Check contents"
+md5sum $dev | sed -e "s|$dev|SCSI_DEBUG_DEV|g"
+
+echo "Destroy device"
+_put_scsi_debug_dev
+
+# success, all done
+status=0
+exit
diff --git a/tests/generic/706.out b/tests/generic/706.out
new file mode 100644
index 0000000..58b9c03
--- /dev/null
+++ b/tests/generic/706.out
@@ -0,0 +1,6 @@
+QA output created by 706
+Create and format
+Zero punch
+Check contents
+caa26edd6c70ce862eb7ec6f10b138a8  SCSI_DEBUG_DEV
+Destroy device
diff --git a/tests/generic/707 b/tests/generic/707
new file mode 100755
index 0000000..fb378cd
--- /dev/null
+++ b/tests/generic/707
@@ -0,0 +1,112 @@
+#! /bin/bash
+# FS QA Test No. 707
+#
+# Test the unsupported fallocate flags on a block device.  No collapse
+# or insert range, no regular fallocate, no forgetting keep-space on
+# zero range, no punching past EOD, no requests that aren't aligned
+# with the logicalsector size, and make sure the fallbacks work for
+# devices that don't support write_same or discard.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016 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.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/scsi_debug
+
+# real QA test starts here
+_supported_os Linux
+_require_scsi_debug
+_require_xfs_io_command "falloc"
+_require_xfs_io_command "finsert"
+_require_xfs_io_command "fcollapse"
+_require_xfs_io_command "fzero"
+_require_xfs_io_command "fpunch"
+
+
+echo "Create and format"
+dev=$(_get_scsi_debug_dev 4096 4096 0 4 "lbpws=1 lbpws10=1")
+_pwrite_byte 0x62 0 4m $dev >> $seqres.full
+$XFS_IO_PROG -c "fsync" $dev
+
+echo "Regular fallocate"
+$XFS_IO_PROG -c "falloc 64k 64k" $dev
+
+echo "Insert range"
+$XFS_IO_PROG -c "finsert 128k 64k" $dev
+
+echo "Collapse range"
+$XFS_IO_PROG -c "fcollapse 256k 64k" $dev
+
+echo "Zero range without keep_size"
+$XFS_IO_PROG -c "fzero 384k 64k" $dev
+
+echo "Zero range past EOD"
+$XFS_IO_PROG -c "fzero -k 3m 4m" $dev
+
+echo "Punch range past EOD"
+$XFS_IO_PROG -c "fpunch 3m 4m" $dev
+
+echo "Unaligned zero range"
+$XFS_IO_PROG -c "fzero -k 512 512" $dev
+
+echo "Unaligned punch"
+$XFS_IO_PROG -c "fpunch 512 512" $dev
+
+echo "Check contents"
+md5sum $dev | sed -e "s|$dev|SCSI_DEBUG_DEV|g"
+
+echo "Destroy device"
+_put_scsi_debug_dev
+
+echo "Create w/o unmap or writesame and format"
+dev=$(_get_scsi_debug_dev 512 512 0 4 "lbpws=0 lbpws10=0 lbpu=0 write_same_length=0 unmap_max_blocks=0")
+_pwrite_byte 0x62 0 4m $dev >> $seqres.full
+$XFS_IO_PROG -c "fsync" $dev
+
+echo "Zero punch, no fallback available"
+$XFS_IO_PROG -c "fpunch 512k 512k" $dev
+
+echo "Zero range, write fallback"
+$XFS_IO_PROG -c "fzero -k 1536k 512k" $dev
+
+echo "Check contents"
+md5sum $dev | sed -e "s|$dev|SCSI_DEBUG_DEV|g"
+
+echo "Destroy device"
+_put_scsi_debug_dev
+
+# success, all done
+status=0
+exit
diff --git a/tests/generic/707.out b/tests/generic/707.out
new file mode 100644
index 0000000..a77e7e5
--- /dev/null
+++ b/tests/generic/707.out
@@ -0,0 +1,28 @@
+QA output created by 707
+Create and format
+Regular fallocate
+fallocate: Operation not supported
+Insert range
+fallocate: Operation not supported
+Collapse range
+fallocate: Operation not supported
+Zero range without keep_size
+fallocate: Operation not supported
+Zero range past EOD
+fallocate: Invalid argument
+Punch range past EOD
+fallocate: Invalid argument
+Unaligned zero range
+fallocate: Invalid argument
+Unaligned punch
+fallocate: Invalid argument
+Check contents
+b83f9394092e15bdcda585cd8e776dc6  SCSI_DEBUG_DEV
+Destroy device
+Create w/o unmap or writesame and format
+Zero punch, no fallback available
+fallocate: Operation not supported
+Zero range, write fallback
+Check contents
+0fc6bc93cd0cd97e3cde5ea39ea1185d  SCSI_DEBUG_DEV
+Destroy device
diff --git a/tests/generic/group b/tests/generic/group
index 727648c..3d375b5 100644
--- a/tests/generic/group
+++ b/tests/generic/group
@@ -340,3 +340,6 @@
 335 auto quick metadata
 336 auto quick metadata
 337 auto quick metadata
+705 auto quick rw
+706 auto quick rw
+707 auto quick rw


^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH 12/12] block: test fallocate for block devices
@ 2016-03-05  0:38   ` Darrick J. Wong
  0 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-05  0:38 UTC (permalink / raw)
  To: david, darrick.wong; +Cc: linux-ext4, fstests, linux-btrfs, xfs

Now that we're wiring up fallocate's PUNCH_HOLE and ZERO_RANGE
features for block devices, add some tests to make sure they
work correctly.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 common/scsi_debug     |    6 ++-
 tests/generic/705     |   65 ++++++++++++++++++++++++++++
 tests/generic/705.out |    6 +++
 tests/generic/706     |   65 ++++++++++++++++++++++++++++
 tests/generic/706.out |    6 +++
 tests/generic/707     |  112 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/707.out |   28 ++++++++++++
 tests/generic/group   |    3 +
 8 files changed, 290 insertions(+), 1 deletion(-)
 create mode 100755 tests/generic/705
 create mode 100644 tests/generic/705.out
 create mode 100755 tests/generic/706
 create mode 100644 tests/generic/706.out
 create mode 100755 tests/generic/707
 create mode 100644 tests/generic/707.out


diff --git a/common/scsi_debug b/common/scsi_debug
index eb08126..74c3802 100644
--- a/common/scsi_debug
+++ b/common/scsi_debug
@@ -40,13 +40,17 @@ _get_scsi_debug_dev()
 	logical=${2-512}
 	unaligned=${3-0}
 	size=${4-128}
+	test -n "$4" && shift
+	test -n "$3" && shift
+	test -n "$2" && shift
+	test -n "$1" && shift
 
 	phys_exp=0
 	while [ $logical -lt $physical ]; do
 		let physical=physical/2
 		let phys_exp=phys_exp+1
 	done
-	opts="sector_size=$logical physblk_exp=$phys_exp lowest_aligned=$unaligned dev_size_mb=$size"
+	opts="sector_size=$logical physblk_exp=$phys_exp lowest_aligned=$unaligned dev_size_mb=$size $@"
 	echo "scsi_debug options $opts" >> $seqres.full
 	modprobe scsi_debug $opts
 	[ $? -eq 0 ] || _fail "scsi_debug modprobe failed"
diff --git a/tests/generic/705 b/tests/generic/705
new file mode 100755
index 0000000..25872ac
--- /dev/null
+++ b/tests/generic/705
@@ -0,0 +1,65 @@
+#! /bin/bash
+# FS QA Test No. 705
+#
+# Test fallocate(ZERO_RANGE) on a block device, which should be able to
+# WRITE SAME (or equivalent) the range.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016 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.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/scsi_debug
+
+# real QA test starts here
+_supported_os Linux
+_require_scsi_debug
+_require_xfs_io_command "fzero"
+
+echo "Create and format"
+dev=$(_get_scsi_debug_dev 512 512 0 4 "lbpws=1 lbpws10=1")
+_pwrite_byte 0x62 0 4m $dev >> $seqres.full
+
+echo "Zero range"
+$XFS_IO_PROG -c "fzero -k 512k 1m" $dev
+
+echo "Check contents"
+md5sum $dev | sed -e "s|$dev|SCSI_DEBUG_DEV|g"
+
+echo "Destroy device"
+_put_scsi_debug_dev
+
+# success, all done
+status=0
+exit
diff --git a/tests/generic/705.out b/tests/generic/705.out
new file mode 100644
index 0000000..7e58a07
--- /dev/null
+++ b/tests/generic/705.out
@@ -0,0 +1,6 @@
+QA output created by 705
+Create and format
+Zero range
+Check contents
+caa26edd6c70ce862eb7ec6f10b138a8  SCSI_DEBUG_DEV
+Destroy device
diff --git a/tests/generic/706 b/tests/generic/706
new file mode 100755
index 0000000..432b800
--- /dev/null
+++ b/tests/generic/706
@@ -0,0 +1,65 @@
+#! /bin/bash
+# FS QA Test No. 706
+#
+# Test fallocate(PUNCH_HOLE) on a block device, which should be able to
+# zero-TRIM (or equivalent) the range.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016 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.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/scsi_debug
+
+# real QA test starts here
+_supported_os Linux
+_require_scsi_debug
+_require_xfs_io_command "fpunch"
+
+echo "Create and format"
+dev=$(_get_scsi_debug_dev 512 512 0 4 "lbpws=1 lbpws10=1")
+_pwrite_byte 0x62 0 4m $dev >> $seqres.full
+
+echo "Zero punch"
+$XFS_IO_PROG -c "fpunch 512k 1m" $dev
+
+echo "Check contents"
+md5sum $dev | sed -e "s|$dev|SCSI_DEBUG_DEV|g"
+
+echo "Destroy device"
+_put_scsi_debug_dev
+
+# success, all done
+status=0
+exit
diff --git a/tests/generic/706.out b/tests/generic/706.out
new file mode 100644
index 0000000..58b9c03
--- /dev/null
+++ b/tests/generic/706.out
@@ -0,0 +1,6 @@
+QA output created by 706
+Create and format
+Zero punch
+Check contents
+caa26edd6c70ce862eb7ec6f10b138a8  SCSI_DEBUG_DEV
+Destroy device
diff --git a/tests/generic/707 b/tests/generic/707
new file mode 100755
index 0000000..fb378cd
--- /dev/null
+++ b/tests/generic/707
@@ -0,0 +1,112 @@
+#! /bin/bash
+# FS QA Test No. 707
+#
+# Test the unsupported fallocate flags on a block device.  No collapse
+# or insert range, no regular fallocate, no forgetting keep-space on
+# zero range, no punching past EOD, no requests that aren't aligned
+# with the logicalsector size, and make sure the fallbacks work for
+# devices that don't support write_same or discard.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016 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.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/scsi_debug
+
+# real QA test starts here
+_supported_os Linux
+_require_scsi_debug
+_require_xfs_io_command "falloc"
+_require_xfs_io_command "finsert"
+_require_xfs_io_command "fcollapse"
+_require_xfs_io_command "fzero"
+_require_xfs_io_command "fpunch"
+
+
+echo "Create and format"
+dev=$(_get_scsi_debug_dev 4096 4096 0 4 "lbpws=1 lbpws10=1")
+_pwrite_byte 0x62 0 4m $dev >> $seqres.full
+$XFS_IO_PROG -c "fsync" $dev
+
+echo "Regular fallocate"
+$XFS_IO_PROG -c "falloc 64k 64k" $dev
+
+echo "Insert range"
+$XFS_IO_PROG -c "finsert 128k 64k" $dev
+
+echo "Collapse range"
+$XFS_IO_PROG -c "fcollapse 256k 64k" $dev
+
+echo "Zero range without keep_size"
+$XFS_IO_PROG -c "fzero 384k 64k" $dev
+
+echo "Zero range past EOD"
+$XFS_IO_PROG -c "fzero -k 3m 4m" $dev
+
+echo "Punch range past EOD"
+$XFS_IO_PROG -c "fpunch 3m 4m" $dev
+
+echo "Unaligned zero range"
+$XFS_IO_PROG -c "fzero -k 512 512" $dev
+
+echo "Unaligned punch"
+$XFS_IO_PROG -c "fpunch 512 512" $dev
+
+echo "Check contents"
+md5sum $dev | sed -e "s|$dev|SCSI_DEBUG_DEV|g"
+
+echo "Destroy device"
+_put_scsi_debug_dev
+
+echo "Create w/o unmap or writesame and format"
+dev=$(_get_scsi_debug_dev 512 512 0 4 "lbpws=0 lbpws10=0 lbpu=0 write_same_length=0 unmap_max_blocks=0")
+_pwrite_byte 0x62 0 4m $dev >> $seqres.full
+$XFS_IO_PROG -c "fsync" $dev
+
+echo "Zero punch, no fallback available"
+$XFS_IO_PROG -c "fpunch 512k 512k" $dev
+
+echo "Zero range, write fallback"
+$XFS_IO_PROG -c "fzero -k 1536k 512k" $dev
+
+echo "Check contents"
+md5sum $dev | sed -e "s|$dev|SCSI_DEBUG_DEV|g"
+
+echo "Destroy device"
+_put_scsi_debug_dev
+
+# success, all done
+status=0
+exit
diff --git a/tests/generic/707.out b/tests/generic/707.out
new file mode 100644
index 0000000..a77e7e5
--- /dev/null
+++ b/tests/generic/707.out
@@ -0,0 +1,28 @@
+QA output created by 707
+Create and format
+Regular fallocate
+fallocate: Operation not supported
+Insert range
+fallocate: Operation not supported
+Collapse range
+fallocate: Operation not supported
+Zero range without keep_size
+fallocate: Operation not supported
+Zero range past EOD
+fallocate: Invalid argument
+Punch range past EOD
+fallocate: Invalid argument
+Unaligned zero range
+fallocate: Invalid argument
+Unaligned punch
+fallocate: Invalid argument
+Check contents
+b83f9394092e15bdcda585cd8e776dc6  SCSI_DEBUG_DEV
+Destroy device
+Create w/o unmap or writesame and format
+Zero punch, no fallback available
+fallocate: Operation not supported
+Zero range, write fallback
+Check contents
+0fc6bc93cd0cd97e3cde5ea39ea1185d  SCSI_DEBUG_DEV
+Destroy device
diff --git a/tests/generic/group b/tests/generic/group
index 727648c..3d375b5 100644
--- a/tests/generic/group
+++ b/tests/generic/group
@@ -340,3 +340,6 @@
 335 auto quick metadata
 336 auto quick metadata
 337 auto quick metadata
+705 auto quick rw
+706 auto quick rw
+707 auto quick rw

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* Re: [PATCH 12/12] block: test fallocate for block devices
  2016-03-05  0:38   ` Darrick J. Wong
@ 2016-03-05 18:25     ` Christoph Hellwig
  -1 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 18:25 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: david, linux-ext4, linux-btrfs, fstests, xfs

I'm not sure xfstests is the right fit, as it does not test a file
system, but rather block devices.

If people think it should go into xfstests we should at least not
add it to the default group, but just to a new bdev group.

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 12/12] block: test fallocate for block devices
@ 2016-03-05 18:25     ` Christoph Hellwig
  0 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 18:25 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-ext4, fstests, linux-btrfs, xfs

I'm not sure xfstests is the right fit, as it does not test a file
system, but rather block devices.

If people think it should go into xfstests we should at least not
add it to the default group, but just to a new bdev group.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 11/12] xfs: remove NOCOW_FL testing from test
  2016-03-05  0:38   ` Darrick J. Wong
@ 2016-03-05 20:10     ` Christoph Hellwig
  -1 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 20:10 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: david, linux-ext4, fstests, linux-btrfs, xfs

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 11/12] xfs: remove NOCOW_FL testing from test
@ 2016-03-05 20:10     ` Christoph Hellwig
  0 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 20:10 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-ext4, linux-btrfs, fstests, xfs

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 08/12] xfs/122: define _GNU_SOURCE when compiling test program
  2016-03-05  0:38   ` Darrick J. Wong
@ 2016-03-05 20:10     ` Christoph Hellwig
  -1 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 20:10 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: david, linux-ext4, fstests, linux-btrfs, xfs

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 08/12] xfs/122: define _GNU_SOURCE when compiling test program
@ 2016-03-05 20:10     ` Christoph Hellwig
  0 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 20:10 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-ext4, linux-btrfs, fstests, xfs

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 09/12] xfs/122: support rmapxbt
  2016-03-05  0:38   ` Darrick J. Wong
@ 2016-03-05 20:12     ` Christoph Hellwig
  -1 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 20:12 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: david, linux-ext4, fstests, linux-btrfs, xfs

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 09/12] xfs/122: support rmapxbt
@ 2016-03-05 20:12     ` Christoph Hellwig
  0 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 20:12 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-ext4, linux-btrfs, fstests, xfs

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 01/12] xfs/207: fix golden output to match FS_IOC_FSSETXATTR hoist
  2016-03-05  0:37   ` Darrick J. Wong
@ 2016-03-05 20:16     ` Christoph Hellwig
  -1 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 20:16 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: david, linux-ext4, fstests, linux-btrfs, xfs

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 01/12] xfs/207: fix golden output to match FS_IOC_FSSETXATTR hoist
@ 2016-03-05 20:16     ` Christoph Hellwig
  0 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 20:16 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-ext4, linux-btrfs, fstests, xfs

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 02/12] xfs: test copy-on-write leftover recovery
  2016-03-05  0:37   ` Darrick J. Wong
@ 2016-03-05 20:17     ` Christoph Hellwig
  -1 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 20:17 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: david, linux-ext4, fstests, linux-btrfs, xfs

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 02/12] xfs: test copy-on-write leftover recovery
@ 2016-03-05 20:17     ` Christoph Hellwig
  0 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 20:17 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-ext4, linux-btrfs, fstests, xfs

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 03/12] reflink: fix fragmentation tests to work on >4k block size filesystems
  2016-03-05  0:37   ` Darrick J. Wong
@ 2016-03-05 20:17     ` Christoph Hellwig
  -1 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 20:17 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: david, linux-ext4, fstests, linux-btrfs, xfs

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 03/12] reflink: fix fragmentation tests to work on >4k block size filesystems
@ 2016-03-05 20:17     ` Christoph Hellwig
  0 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 20:17 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-ext4, linux-btrfs, fstests, xfs

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 04/12] xfs/23[3-6]: don't source common/xfs, it doesn't exist
  2016-03-05  0:37   ` Darrick J. Wong
@ 2016-03-05 20:19     ` Christoph Hellwig
  -1 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 20:19 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: david, linux-ext4, fstests, linux-btrfs, xfs

On Fri, Mar 04, 2016 at 04:37:43PM -0800, Darrick J. Wong wrote:
> Don't source common/xfs, since it doesn't (yet) exist.

Heh.  Wonder how they ever worked before..
(they probably didn't, and I didn't notice as I never ran with rmapbt)

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 04/12] xfs/23[3-6]: don't source common/xfs, it doesn't exist
@ 2016-03-05 20:19     ` Christoph Hellwig
  0 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 20:19 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-ext4, linux-btrfs, fstests, xfs

On Fri, Mar 04, 2016 at 04:37:43PM -0800, Darrick J. Wong wrote:
> Don't source common/xfs, since it doesn't (yet) exist.

Heh.  Wonder how they ever worked before..
(they probably didn't, and I didn't notice as I never ran with rmapbt)

Reviewed-by: Christoph Hellwig <hch@lst.de>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 05/12] xfs/206: fix output when mkfs knows about reflink
  2016-03-05  0:37   ` Darrick J. Wong
@ 2016-03-05 20:19     ` Christoph Hellwig
  -1 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 20:19 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: david, linux-ext4, fstests, linux-btrfs, xfs

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 05/12] xfs/206: fix output when mkfs knows about reflink
@ 2016-03-05 20:19     ` Christoph Hellwig
  0 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 20:19 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-ext4, linux-btrfs, fstests, xfs

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 06/12] xfs/030: fix output on newer filesystems
  2016-03-05  0:37   ` Darrick J. Wong
@ 2016-03-05 20:20     ` Christoph Hellwig
  -1 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 20:20 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: david, linux-ext4, fstests, linux-btrfs, xfs

Still fails for me:

--- tests/xfs/030.out	2016-03-03 07:55:58.556427678 +0000
+++ /root/xfstests/results//xfs/030.out.bad	2016-03-05 20:20:17.561433837 +0000
@@ -231,8 +231,6 @@
 bad agbno AGBNO in agfl, agno 0
 bad agbno AGBNO in agfl, agno 0
 bad agbno AGBNO in agfl, agno 0
-bad agbno AGBNO in agfl, agno 0
-bad agbno AGBNO in agfl, agno 0
         - found root inode chunk
 Phase 3 - for each AG...
         - scan and clear agi unlinked lists...

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 06/12] xfs/030: fix output on newer filesystems
@ 2016-03-05 20:20     ` Christoph Hellwig
  0 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 20:20 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-ext4, linux-btrfs, fstests, xfs

Still fails for me:

--- tests/xfs/030.out	2016-03-03 07:55:58.556427678 +0000
+++ /root/xfstests/results//xfs/030.out.bad	2016-03-05 20:20:17.561433837 +0000
@@ -231,8 +231,6 @@
 bad agbno AGBNO in agfl, agno 0
 bad agbno AGBNO in agfl, agno 0
 bad agbno AGBNO in agfl, agno 0
-bad agbno AGBNO in agfl, agno 0
-bad agbno AGBNO in agfl, agno 0
         - found root inode chunk
 Phase 3 - for each AG...
         - scan and clear agi unlinked lists...

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 07/12] xfs/073: fix output
  2016-03-05  0:38   ` Darrick J. Wong
@ 2016-03-05 20:22     ` Christoph Hellwig
  -1 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 20:22 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: david, linux-ext4, fstests, linux-btrfs, xfs

Fixes one warning for my config, but adds two new ones (see below).
Looks like we need to do some better feature detection.


--- tests/xfs/073.out	2016-03-03 07:55:58.556427678 +0000
+++ /root/xfstests/results//xfs/073.out.bad	2016-03-05 20:21:07.368100504 +0000
@@ -1,6 +1,4 @@
 QA output created by 073
-warning: finobt not supported without CRC support, disabled.
-warning: rmapbt not supported without CRC support, disabled.
 warning: reflink not supported without CRC support, disabled.
 meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
 data     = bsize=XXX blocks=XXX, imaxpct=PCT
@@ -38,6 +36,7 @@
 unmounting and removing new image
 
 === copying scratch device to single target, large ro device
+warning: reflink not supported without CRC support, disabled.
 meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
 data     = bsize=XXX blocks=XXX, imaxpct=PCT
          = sunit=XXX swidth=XXX, unwritten=X
@@ -51,6 +50,7 @@
 checking new image
 mounting new image on loopback
 comparing new image files to old
+File /mnt/test/23382.source_dir/xfstests/dev is a block special file while file /mnt/test/23382.loop/xfstests/dev is a block special file
 comparing new image directories to old
 comparing new image geometry to old
 unmounting and removing new image

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 07/12] xfs/073: fix output
@ 2016-03-05 20:22     ` Christoph Hellwig
  0 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 20:22 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-ext4, linux-btrfs, fstests, xfs

Fixes one warning for my config, but adds two new ones (see below).
Looks like we need to do some better feature detection.


--- tests/xfs/073.out	2016-03-03 07:55:58.556427678 +0000
+++ /root/xfstests/results//xfs/073.out.bad	2016-03-05 20:21:07.368100504 +0000
@@ -1,6 +1,4 @@
 QA output created by 073
-warning: finobt not supported without CRC support, disabled.
-warning: rmapbt not supported without CRC support, disabled.
 warning: reflink not supported without CRC support, disabled.
 meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
 data     = bsize=XXX blocks=XXX, imaxpct=PCT
@@ -38,6 +36,7 @@
 unmounting and removing new image
 
 === copying scratch device to single target, large ro device
+warning: reflink not supported without CRC support, disabled.
 meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
 data     = bsize=XXX blocks=XXX, imaxpct=PCT
          = sunit=XXX swidth=XXX, unwritten=X
@@ -51,6 +50,7 @@
 checking new image
 mounting new image on loopback
 comparing new image files to old
+File /mnt/test/23382.source_dir/xfstests/dev is a block special file while file /mnt/test/23382.loop/xfstests/dev is a block special file
 comparing new image directories to old
 comparing new image geometry to old
 unmounting and removing new image

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 10/12] xfs: test per-ag allocation accounting during truncate-caused refcountbt expansion
  2016-03-05  0:38   ` Darrick J. Wong
@ 2016-03-05 20:23     ` Christoph Hellwig
  -1 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 20:23 UTC (permalink / raw)
  To: Darrick J. Wong
  Cc: david, fstests, linux-ext4, Christoph Hellwig, linux-btrfs, xfs

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 10/12] xfs: test per-ag allocation accounting during truncate-caused refcountbt expansion
@ 2016-03-05 20:23     ` Christoph Hellwig
  0 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 20:23 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: fstests, xfs, linux-ext4, Christoph Hellwig, linux-btrfs

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 64+ messages in thread

* [PATCH 13/12] xfs/209: filter scratch dir properly
  2016-03-05  0:37 ` Darrick J. Wong
@ 2016-03-05 20:25   ` Christoph Hellwig
  -1 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 20:25 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: david, linux-ext4, fstests, linux-btrfs, xfs

Signed-off-by: Christoph Hellwig <hch@lst.de>

diff --git a/tests/xfs/209 b/tests/xfs/209
index cecd9c7..9bf1f12 100755
--- a/tests/xfs/209
+++ b/tests/xfs/209
@@ -73,7 +73,7 @@ echo "Check cowextsize settings"
 seq 1 2 | while read nr; do
 	seq 1 4 | while read nnr; do
 		file="$testdir/dir-$nr/file-$nnr"
-		$XFS_IO_PROG -c "cowextsize" $file
+		$XFS_IO_PROG -c "cowextsize" $file | _filter_scratch
 	done
 done
 
diff --git a/tests/xfs/209.out b/tests/xfs/209.out
index 109af34..b97fa96 100644
--- a/tests/xfs/209.out
+++ b/tests/xfs/209.out
@@ -3,11 +3,11 @@ Format and mount
 Set extsz and cowextsz on directory
 Create a fake tree structure
 Check cowextsize settings
-[1048576] /opt/test-209/dir-1/file-1
-[1048576] /opt/test-209/dir-1/file-2
-[1048576] /opt/test-209/dir-1/file-3
-[1048576] /opt/test-209/dir-1/file-4
-[1048576] /opt/test-209/dir-2/file-1
-[1048576] /opt/test-209/dir-2/file-2
-[1048576] /opt/test-209/dir-2/file-3
-[1048576] /opt/test-209/dir-2/file-4
+[1048576] SCRATCH_MNT/test-209/dir-1/file-1
+[1048576] SCRATCH_MNT/test-209/dir-1/file-2
+[1048576] SCRATCH_MNT/test-209/dir-1/file-3
+[1048576] SCRATCH_MNT/test-209/dir-1/file-4
+[1048576] SCRATCH_MNT/test-209/dir-2/file-1
+[1048576] SCRATCH_MNT/test-209/dir-2/file-2
+[1048576] SCRATCH_MNT/test-209/dir-2/file-3
+[1048576] SCRATCH_MNT/test-209/dir-2/file-4

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH 13/12] xfs/209: filter scratch dir properly
@ 2016-03-05 20:25   ` Christoph Hellwig
  0 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-05 20:25 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-ext4, linux-btrfs, fstests, xfs

Signed-off-by: Christoph Hellwig <hch@lst.de>

diff --git a/tests/xfs/209 b/tests/xfs/209
index cecd9c7..9bf1f12 100755
--- a/tests/xfs/209
+++ b/tests/xfs/209
@@ -73,7 +73,7 @@ echo "Check cowextsize settings"
 seq 1 2 | while read nr; do
 	seq 1 4 | while read nnr; do
 		file="$testdir/dir-$nr/file-$nnr"
-		$XFS_IO_PROG -c "cowextsize" $file
+		$XFS_IO_PROG -c "cowextsize" $file | _filter_scratch
 	done
 done
 
diff --git a/tests/xfs/209.out b/tests/xfs/209.out
index 109af34..b97fa96 100644
--- a/tests/xfs/209.out
+++ b/tests/xfs/209.out
@@ -3,11 +3,11 @@ Format and mount
 Set extsz and cowextsz on directory
 Create a fake tree structure
 Check cowextsize settings
-[1048576] /opt/test-209/dir-1/file-1
-[1048576] /opt/test-209/dir-1/file-2
-[1048576] /opt/test-209/dir-1/file-3
-[1048576] /opt/test-209/dir-1/file-4
-[1048576] /opt/test-209/dir-2/file-1
-[1048576] /opt/test-209/dir-2/file-2
-[1048576] /opt/test-209/dir-2/file-3
-[1048576] /opt/test-209/dir-2/file-4
+[1048576] SCRATCH_MNT/test-209/dir-1/file-1
+[1048576] SCRATCH_MNT/test-209/dir-1/file-2
+[1048576] SCRATCH_MNT/test-209/dir-1/file-3
+[1048576] SCRATCH_MNT/test-209/dir-1/file-4
+[1048576] SCRATCH_MNT/test-209/dir-2/file-1
+[1048576] SCRATCH_MNT/test-209/dir-2/file-2
+[1048576] SCRATCH_MNT/test-209/dir-2/file-3
+[1048576] SCRATCH_MNT/test-209/dir-2/file-4

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* Re: [PATCH 13/12] xfs/209: filter scratch dir properly
  2016-03-05 20:25   ` Christoph Hellwig
@ 2016-03-06 22:09     ` Darrick J. Wong
  -1 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-06 22:09 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: david, linux-ext4, fstests, linux-btrfs, xfs

Good catch,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

On Sat, Mar 05, 2016 at 12:25:02PM -0800, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> 
> diff --git a/tests/xfs/209 b/tests/xfs/209
> index cecd9c7..9bf1f12 100755
> --- a/tests/xfs/209
> +++ b/tests/xfs/209
> @@ -73,7 +73,7 @@ echo "Check cowextsize settings"
>  seq 1 2 | while read nr; do
>  	seq 1 4 | while read nnr; do
>  		file="$testdir/dir-$nr/file-$nnr"
> -		$XFS_IO_PROG -c "cowextsize" $file
> +		$XFS_IO_PROG -c "cowextsize" $file | _filter_scratch
>  	done
>  done
>  
> diff --git a/tests/xfs/209.out b/tests/xfs/209.out
> index 109af34..b97fa96 100644
> --- a/tests/xfs/209.out
> +++ b/tests/xfs/209.out
> @@ -3,11 +3,11 @@ Format and mount
>  Set extsz and cowextsz on directory
>  Create a fake tree structure
>  Check cowextsize settings
> -[1048576] /opt/test-209/dir-1/file-1
> -[1048576] /opt/test-209/dir-1/file-2
> -[1048576] /opt/test-209/dir-1/file-3
> -[1048576] /opt/test-209/dir-1/file-4
> -[1048576] /opt/test-209/dir-2/file-1
> -[1048576] /opt/test-209/dir-2/file-2
> -[1048576] /opt/test-209/dir-2/file-3
> -[1048576] /opt/test-209/dir-2/file-4
> +[1048576] SCRATCH_MNT/test-209/dir-1/file-1
> +[1048576] SCRATCH_MNT/test-209/dir-1/file-2
> +[1048576] SCRATCH_MNT/test-209/dir-1/file-3
> +[1048576] SCRATCH_MNT/test-209/dir-1/file-4
> +[1048576] SCRATCH_MNT/test-209/dir-2/file-1
> +[1048576] SCRATCH_MNT/test-209/dir-2/file-2
> +[1048576] SCRATCH_MNT/test-209/dir-2/file-3
> +[1048576] SCRATCH_MNT/test-209/dir-2/file-4
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 13/12] xfs/209: filter scratch dir properly
@ 2016-03-06 22:09     ` Darrick J. Wong
  0 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-06 22:09 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-ext4, linux-btrfs, fstests, xfs

Good catch,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

On Sat, Mar 05, 2016 at 12:25:02PM -0800, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> 
> diff --git a/tests/xfs/209 b/tests/xfs/209
> index cecd9c7..9bf1f12 100755
> --- a/tests/xfs/209
> +++ b/tests/xfs/209
> @@ -73,7 +73,7 @@ echo "Check cowextsize settings"
>  seq 1 2 | while read nr; do
>  	seq 1 4 | while read nnr; do
>  		file="$testdir/dir-$nr/file-$nnr"
> -		$XFS_IO_PROG -c "cowextsize" $file
> +		$XFS_IO_PROG -c "cowextsize" $file | _filter_scratch
>  	done
>  done
>  
> diff --git a/tests/xfs/209.out b/tests/xfs/209.out
> index 109af34..b97fa96 100644
> --- a/tests/xfs/209.out
> +++ b/tests/xfs/209.out
> @@ -3,11 +3,11 @@ Format and mount
>  Set extsz and cowextsz on directory
>  Create a fake tree structure
>  Check cowextsize settings
> -[1048576] /opt/test-209/dir-1/file-1
> -[1048576] /opt/test-209/dir-1/file-2
> -[1048576] /opt/test-209/dir-1/file-3
> -[1048576] /opt/test-209/dir-1/file-4
> -[1048576] /opt/test-209/dir-2/file-1
> -[1048576] /opt/test-209/dir-2/file-2
> -[1048576] /opt/test-209/dir-2/file-3
> -[1048576] /opt/test-209/dir-2/file-4
> +[1048576] SCRATCH_MNT/test-209/dir-1/file-1
> +[1048576] SCRATCH_MNT/test-209/dir-1/file-2
> +[1048576] SCRATCH_MNT/test-209/dir-1/file-3
> +[1048576] SCRATCH_MNT/test-209/dir-1/file-4
> +[1048576] SCRATCH_MNT/test-209/dir-2/file-1
> +[1048576] SCRATCH_MNT/test-209/dir-2/file-2
> +[1048576] SCRATCH_MNT/test-209/dir-2/file-3
> +[1048576] SCRATCH_MNT/test-209/dir-2/file-4
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 12/12] block: test fallocate for block devices
  2016-03-05 18:25     ` Christoph Hellwig
@ 2016-03-07  8:26       ` Darrick J. Wong
  -1 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-07  8:26 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: david, linux-ext4, linux-btrfs, fstests, xfs

On Sat, Mar 05, 2016 at 10:25:08AM -0800, Christoph Hellwig wrote:
> I'm not sure xfstests is the right fit, as it does not test a file
> system, but rather block devices.

I asked Dave if he'd take a fallocate-for-bdevs test, and he didn't
object.  After all, we're testing a semi-standard FS API, just with
block devices.

> If people think it should go into xfstests we should at least not
> add it to the default group, but just to a new bdev group.

Sure, I don't mind changing the group to 'bdev' or something.

--D

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 12/12] block: test fallocate for block devices
@ 2016-03-07  8:26       ` Darrick J. Wong
  0 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-07  8:26 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-ext4, fstests, linux-btrfs, xfs

On Sat, Mar 05, 2016 at 10:25:08AM -0800, Christoph Hellwig wrote:
> I'm not sure xfstests is the right fit, as it does not test a file
> system, but rather block devices.

I asked Dave if he'd take a fallocate-for-bdevs test, and he didn't
object.  After all, we're testing a semi-standard FS API, just with
block devices.

> If people think it should go into xfstests we should at least not
> add it to the default group, but just to a new bdev group.

Sure, I don't mind changing the group to 'bdev' or something.

--D

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 12/12] block: test fallocate for block devices
  2016-03-05 18:25     ` Christoph Hellwig
@ 2016-03-15  3:41       ` Dave Chinner
  -1 siblings, 0 replies; 64+ messages in thread
From: Dave Chinner @ 2016-03-15  3:41 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Darrick J. Wong, linux-ext4, linux-btrfs, fstests, xfs

On Sat, Mar 05, 2016 at 10:25:08AM -0800, Christoph Hellwig wrote:
> I'm not sure xfstests is the right fit, as it does not test a file
> system, but rather block devices.
> 
> If people think it should go into xfstests we should at least not
> add it to the default group, but just to a new bdev group.

I think it's the right place to test it - we have all the
infrastructure available to do it (i.e. xfs_io and various block
devices) and we really need to make sure this stuff works,
especially if we start to write filesystem code that depends on
correct behaviour...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 12/12] block: test fallocate for block devices
@ 2016-03-15  3:41       ` Dave Chinner
  0 siblings, 0 replies; 64+ messages in thread
From: Dave Chinner @ 2016-03-15  3:41 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs, linux-ext4, fstests, linux-btrfs, Darrick J. Wong

On Sat, Mar 05, 2016 at 10:25:08AM -0800, Christoph Hellwig wrote:
> I'm not sure xfstests is the right fit, as it does not test a file
> system, but rather block devices.
> 
> If people think it should go into xfstests we should at least not
> add it to the default group, but just to a new bdev group.

I think it's the right place to test it - we have all the
infrastructure available to do it (i.e. xfs_io and various block
devices) and we really need to make sure this stuff works,
especially if we start to write filesystem code that depends on
correct behaviour...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 12/12] block: test fallocate for block devices
  2016-03-15  3:41       ` Dave Chinner
@ 2016-03-15  8:34         ` Christoph Hellwig
  -1 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-15  8:34 UTC (permalink / raw)
  To: Dave Chinner
  Cc: Christoph Hellwig, Darrick J. Wong, linux-ext4, linux-btrfs,
	fstests, xfs

On Tue, Mar 15, 2016 at 02:41:48PM +1100, Dave Chinner wrote:
> I think it's the right place to test it - we have all the
> infrastructure available to do it (i.e. xfs_io and various block
> devices) and we really need to make sure this stuff works,
> especially if we start to write filesystem code that depends on
> correct behaviour...

Ok.  But let's keep it outside of the auto group so we don't run purely
block device specific tests every time we do an xfstests run.

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 12/12] block: test fallocate for block devices
@ 2016-03-15  8:34         ` Christoph Hellwig
  0 siblings, 0 replies; 64+ messages in thread
From: Christoph Hellwig @ 2016-03-15  8:34 UTC (permalink / raw)
  To: Dave Chinner
  Cc: Darrick J. Wong, fstests, xfs, Christoph Hellwig, linux-ext4,
	linux-btrfs

On Tue, Mar 15, 2016 at 02:41:48PM +1100, Dave Chinner wrote:
> I think it's the right place to test it - we have all the
> infrastructure available to do it (i.e. xfs_io and various block
> devices) and we really need to make sure this stuff works,
> especially if we start to write filesystem code that depends on
> correct behaviour...

Ok.  But let's keep it outside of the auto group so we don't run purely
block device specific tests every time we do an xfstests run.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 64+ messages in thread

* [PATCH v2 12/12] block: test fallocate for block devices
  2016-03-05  0:38   ` Darrick J. Wong
@ 2016-03-15 19:25     ` Darrick J. Wong
  -1 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-15 19:25 UTC (permalink / raw)
  To: david; +Cc: linux-ext4, linux-btrfs, fstests, xfs, Christoph Hellwig

Now that we're wiring up fallocate's PUNCH_HOLE and ZERO_RANGE
features for block devices, add some tests to make sure they
work correctly.

v2: Update tests to reflect EOD clamping suggested by Linus.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 common/scsi_debug     |    6 ++
 tests/generic/705     |   77 ++++++++++++++++++++++++++++++++
 tests/generic/705.out |   11 +++++
 tests/generic/706     |   74 +++++++++++++++++++++++++++++++
 tests/generic/706.out |   10 ++++
 tests/generic/707     |  118 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/707.out |   32 +++++++++++++
 tests/generic/group   |    3 +
 8 files changed, 330 insertions(+), 1 deletion(-)
 create mode 100755 tests/generic/705
 create mode 100644 tests/generic/705.out
 create mode 100755 tests/generic/706
 create mode 100644 tests/generic/706.out
 create mode 100755 tests/generic/707
 create mode 100644 tests/generic/707.out

diff --git a/common/scsi_debug b/common/scsi_debug
index eb08126..74c3802 100644
--- a/common/scsi_debug
+++ b/common/scsi_debug
@@ -40,13 +40,17 @@ _get_scsi_debug_dev()
 	logical=${2-512}
 	unaligned=${3-0}
 	size=${4-128}
+	test -n "$4" && shift
+	test -n "$3" && shift
+	test -n "$2" && shift
+	test -n "$1" && shift
 
 	phys_exp=0
 	while [ $logical -lt $physical ]; do
 		let physical=physical/2
 		let phys_exp=phys_exp+1
 	done
-	opts="sector_size=$logical physblk_exp=$phys_exp lowest_aligned=$unaligned dev_size_mb=$size"
+	opts="sector_size=$logical physblk_exp=$phys_exp lowest_aligned=$unaligned dev_size_mb=$size $@"
 	echo "scsi_debug options $opts" >> $seqres.full
 	modprobe scsi_debug $opts
 	[ $? -eq 0 ] || _fail "scsi_debug modprobe failed"
diff --git a/tests/generic/705 b/tests/generic/705
new file mode 100755
index 0000000..4bb8752
--- /dev/null
+++ b/tests/generic/705
@@ -0,0 +1,77 @@
+#! /bin/bash
+# FS QA Test No. 705
+#
+# Test fallocate(ZERO_RANGE) on a block device, which should be able to
+# WRITE SAME (or equivalent) the range.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016 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.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/scsi_debug
+
+# real QA test starts here
+_supported_os Linux
+_require_scsi_debug
+_require_xfs_io_command "fzero"
+
+echo "Create and format"
+dev=$(_get_scsi_debug_dev 512 512 0 4 "lbpws=1 lbpws10=1")
+_pwrite_byte 0x62 0 4m $dev >> $seqres.full
+
+echo "Zero range"
+$XFS_IO_PROG -c "fzero -k 512k 1m" $dev
+
+echo "Zero range without keep_size"
+$XFS_IO_PROG -c "fzero 384k 64k" $dev
+
+echo "Zero range past EOD"
+$XFS_IO_PROG -c "fzero -k 3m 4m" $dev
+
+echo "Check contents"
+md5sum $dev | sed -e "s|$dev|SCSI_DEBUG_DEV|g"
+
+echo "Zero range to EOD"
+$XFS_IO_PROG -c "fzero -k 0 9223372036854775807" $dev
+
+echo "Check contents"
+md5sum $dev | sed -e "s|$dev|SCSI_DEBUG_DEV|g"
+
+echo "Destroy device"
+_put_scsi_debug_dev
+
+# success, all done
+status=0
+exit
diff --git a/tests/generic/705.out b/tests/generic/705.out
new file mode 100644
index 0000000..ccbda23
--- /dev/null
+++ b/tests/generic/705.out
@@ -0,0 +1,11 @@
+QA output created by 705
+Create and format
+Zero range
+Zero range without keep_size
+Zero range past EOD
+Check contents
+f0cb9070c098aa347f664bead3a219d9  SCSI_DEBUG_DEV
+Zero range to EOD
+Check contents
+b5cfa9d6c8febd618f91ac2843d50a1c  SCSI_DEBUG_DEV
+Destroy device
diff --git a/tests/generic/706 b/tests/generic/706
new file mode 100755
index 0000000..184dbc2
--- /dev/null
+++ b/tests/generic/706
@@ -0,0 +1,74 @@
+#! /bin/bash
+# FS QA Test No. 706
+#
+# Test fallocate(PUNCH_HOLE) on a block device, which should be able to
+# zero-TRIM (or equivalent) the range.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016 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.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/scsi_debug
+
+# real QA test starts here
+_supported_os Linux
+_require_scsi_debug
+_require_xfs_io_command "fpunch"
+
+echo "Create and format"
+dev=$(_get_scsi_debug_dev 512 512 0 4 "lbpws=1 lbpws10=1")
+_pwrite_byte 0x62 0 4m $dev >> $seqres.full
+
+echo "Zero punch"
+$XFS_IO_PROG -c "fpunch 512k 1m" $dev
+
+echo "Punch range past EOD"
+$XFS_IO_PROG -c "fpunch 3m 4m" $dev
+
+echo "Check contents"
+md5sum $dev | sed -e "s|$dev|SCSI_DEBUG_DEV|g"
+
+echo "Punch to EOD"
+$XFS_IO_PROG -c "fpunch 0 9223372036854775807" $dev
+
+echo "Check contents"
+md5sum $dev | sed -e "s|$dev|SCSI_DEBUG_DEV|g"
+
+echo "Destroy device"
+_put_scsi_debug_dev
+
+# success, all done
+status=0
+exit
diff --git a/tests/generic/706.out b/tests/generic/706.out
new file mode 100644
index 0000000..53a09ae
--- /dev/null
+++ b/tests/generic/706.out
@@ -0,0 +1,10 @@
+QA output created by 706
+Create and format
+Zero punch
+Punch range past EOD
+Check contents
+8c6a3fd51601141b56eaebbab3746156  SCSI_DEBUG_DEV
+Punch to EOD
+Check contents
+b5cfa9d6c8febd618f91ac2843d50a1c  SCSI_DEBUG_DEV
+Destroy device
diff --git a/tests/generic/707 b/tests/generic/707
new file mode 100755
index 0000000..fab997f
--- /dev/null
+++ b/tests/generic/707
@@ -0,0 +1,118 @@
+#! /bin/bash
+# FS QA Test No. 707
+#
+# Test the unsupported fallocate flags on a block device.  No collapse
+# or insert range, no regular fallocate, no forgetting keep-space on
+# zero range, no punching past EOD, no requests that aren't aligned
+# with the logicalsector size, and make sure the fallbacks work for
+# devices that don't support write_same or discard.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016 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.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/scsi_debug
+
+# real QA test starts here
+_supported_os Linux
+_require_scsi_debug
+_require_xfs_io_command "falloc"
+_require_xfs_io_command "finsert"
+_require_xfs_io_command "fcollapse"
+_require_xfs_io_command "fzero"
+_require_xfs_io_command "fpunch"
+
+
+echo "Create and format"
+dev=$(_get_scsi_debug_dev 4096 4096 0 4 "lbpws=1 lbpws10=1")
+_pwrite_byte 0x62 0 4m $dev >> $seqres.full
+$XFS_IO_PROG -c "fsync" $dev
+
+echo "Regular fallocate"
+$XFS_IO_PROG -c "falloc 64k 64k" $dev
+
+echo "Insert range"
+$XFS_IO_PROG -c "finsert 128k 64k" $dev
+
+echo "Collapse range"
+$XFS_IO_PROG -c "fcollapse 256k 64k" $dev
+
+echo "Unaligned zero range"
+$XFS_IO_PROG -c "fzero -k 512 512" $dev
+
+echo "Unaligned punch"
+$XFS_IO_PROG -c "fpunch 512 512" $dev
+
+echo "Zero range toobig keep size"
+$XFS_IO_PROG -c "fzero -k 512k 9223372036854775807" $dev
+
+echo "Zero range toobig"
+$XFS_IO_PROG -c "fzero 512k 9223372036854775807" $dev
+
+echo "Zero range to EOD fail w/o keepsize"
+$XFS_IO_PROG -c "fzero 0 9223372036854775807" $dev
+
+echo "Zero range starts past EOD"
+$XFS_IO_PROG -c "fzero -k 900m 1m" $dev
+
+echo "Punch starts past EOD"
+$XFS_IO_PROG -c "fpunch 900m 1m" $dev
+
+echo "Check contents"
+md5sum $dev | sed -e "s|$dev|SCSI_DEBUG_DEV|g"
+
+echo "Destroy device"
+_put_scsi_debug_dev
+
+echo "Create w/o unmap or writesame and format"
+dev=$(_get_scsi_debug_dev 512 512 0 4 "lbpws=0 lbpws10=0 lbpu=0 write_same_length=0 unmap_max_blocks=0")
+_pwrite_byte 0x62 0 4m $dev >> $seqres.full
+$XFS_IO_PROG -c "fsync" $dev
+
+echo "Zero punch, no fallback available"
+$XFS_IO_PROG -c "fpunch 512k 512k" $dev
+
+echo "Zero range, write fallback"
+$XFS_IO_PROG -c "fzero -k 1536k 512k" $dev
+
+echo "Check contents"
+md5sum $dev | sed -e "s|$dev|SCSI_DEBUG_DEV|g"
+
+echo "Destroy device"
+_put_scsi_debug_dev
+
+# success, all done
+status=0
+exit
diff --git a/tests/generic/707.out b/tests/generic/707.out
new file mode 100644
index 0000000..050c70c
--- /dev/null
+++ b/tests/generic/707.out
@@ -0,0 +1,32 @@
+QA output created by 707
+Create and format
+Regular fallocate
+fallocate: Operation not supported
+Insert range
+fallocate: Operation not supported
+Collapse range
+fallocate: Operation not supported
+Unaligned zero range
+fallocate: Invalid argument
+Unaligned punch
+fallocate: Invalid argument
+Zero range toobig keep size
+fallocate: File too large
+Zero range toobig
+fallocate: File too large
+Zero range to EOD fail w/o keepsize
+fallocate: Invalid argument
+Zero range starts past EOD
+fallocate: Invalid argument
+Punch starts past EOD
+fallocate: Invalid argument
+Check contents
+b83f9394092e15bdcda585cd8e776dc6  SCSI_DEBUG_DEV
+Destroy device
+Create w/o unmap or writesame and format
+Zero punch, no fallback available
+fallocate: Operation not supported
+Zero range, write fallback
+Check contents
+0fc6bc93cd0cd97e3cde5ea39ea1185d  SCSI_DEBUG_DEV
+Destroy device
diff --git a/tests/generic/group b/tests/generic/group
index 727648c..51a2d63 100644
--- a/tests/generic/group
+++ b/tests/generic/group
@@ -340,3 +340,6 @@
 335 auto quick metadata
 336 auto quick metadata
 337 auto quick metadata
+705 blockdev quick rw
+706 blockdev quick rw
+707 blockdev quick rw

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH v2 12/12] block: test fallocate for block devices
@ 2016-03-15 19:25     ` Darrick J. Wong
  0 siblings, 0 replies; 64+ messages in thread
From: Darrick J. Wong @ 2016-03-15 19:25 UTC (permalink / raw)
  To: david; +Cc: Christoph Hellwig, linux-ext4, fstests, linux-btrfs, xfs

Now that we're wiring up fallocate's PUNCH_HOLE and ZERO_RANGE
features for block devices, add some tests to make sure they
work correctly.

v2: Update tests to reflect EOD clamping suggested by Linus.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 common/scsi_debug     |    6 ++
 tests/generic/705     |   77 ++++++++++++++++++++++++++++++++
 tests/generic/705.out |   11 +++++
 tests/generic/706     |   74 +++++++++++++++++++++++++++++++
 tests/generic/706.out |   10 ++++
 tests/generic/707     |  118 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/707.out |   32 +++++++++++++
 tests/generic/group   |    3 +
 8 files changed, 330 insertions(+), 1 deletion(-)
 create mode 100755 tests/generic/705
 create mode 100644 tests/generic/705.out
 create mode 100755 tests/generic/706
 create mode 100644 tests/generic/706.out
 create mode 100755 tests/generic/707
 create mode 100644 tests/generic/707.out

diff --git a/common/scsi_debug b/common/scsi_debug
index eb08126..74c3802 100644
--- a/common/scsi_debug
+++ b/common/scsi_debug
@@ -40,13 +40,17 @@ _get_scsi_debug_dev()
 	logical=${2-512}
 	unaligned=${3-0}
 	size=${4-128}
+	test -n "$4" && shift
+	test -n "$3" && shift
+	test -n "$2" && shift
+	test -n "$1" && shift
 
 	phys_exp=0
 	while [ $logical -lt $physical ]; do
 		let physical=physical/2
 		let phys_exp=phys_exp+1
 	done
-	opts="sector_size=$logical physblk_exp=$phys_exp lowest_aligned=$unaligned dev_size_mb=$size"
+	opts="sector_size=$logical physblk_exp=$phys_exp lowest_aligned=$unaligned dev_size_mb=$size $@"
 	echo "scsi_debug options $opts" >> $seqres.full
 	modprobe scsi_debug $opts
 	[ $? -eq 0 ] || _fail "scsi_debug modprobe failed"
diff --git a/tests/generic/705 b/tests/generic/705
new file mode 100755
index 0000000..4bb8752
--- /dev/null
+++ b/tests/generic/705
@@ -0,0 +1,77 @@
+#! /bin/bash
+# FS QA Test No. 705
+#
+# Test fallocate(ZERO_RANGE) on a block device, which should be able to
+# WRITE SAME (or equivalent) the range.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016 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.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/scsi_debug
+
+# real QA test starts here
+_supported_os Linux
+_require_scsi_debug
+_require_xfs_io_command "fzero"
+
+echo "Create and format"
+dev=$(_get_scsi_debug_dev 512 512 0 4 "lbpws=1 lbpws10=1")
+_pwrite_byte 0x62 0 4m $dev >> $seqres.full
+
+echo "Zero range"
+$XFS_IO_PROG -c "fzero -k 512k 1m" $dev
+
+echo "Zero range without keep_size"
+$XFS_IO_PROG -c "fzero 384k 64k" $dev
+
+echo "Zero range past EOD"
+$XFS_IO_PROG -c "fzero -k 3m 4m" $dev
+
+echo "Check contents"
+md5sum $dev | sed -e "s|$dev|SCSI_DEBUG_DEV|g"
+
+echo "Zero range to EOD"
+$XFS_IO_PROG -c "fzero -k 0 9223372036854775807" $dev
+
+echo "Check contents"
+md5sum $dev | sed -e "s|$dev|SCSI_DEBUG_DEV|g"
+
+echo "Destroy device"
+_put_scsi_debug_dev
+
+# success, all done
+status=0
+exit
diff --git a/tests/generic/705.out b/tests/generic/705.out
new file mode 100644
index 0000000..ccbda23
--- /dev/null
+++ b/tests/generic/705.out
@@ -0,0 +1,11 @@
+QA output created by 705
+Create and format
+Zero range
+Zero range without keep_size
+Zero range past EOD
+Check contents
+f0cb9070c098aa347f664bead3a219d9  SCSI_DEBUG_DEV
+Zero range to EOD
+Check contents
+b5cfa9d6c8febd618f91ac2843d50a1c  SCSI_DEBUG_DEV
+Destroy device
diff --git a/tests/generic/706 b/tests/generic/706
new file mode 100755
index 0000000..184dbc2
--- /dev/null
+++ b/tests/generic/706
@@ -0,0 +1,74 @@
+#! /bin/bash
+# FS QA Test No. 706
+#
+# Test fallocate(PUNCH_HOLE) on a block device, which should be able to
+# zero-TRIM (or equivalent) the range.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016 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.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/scsi_debug
+
+# real QA test starts here
+_supported_os Linux
+_require_scsi_debug
+_require_xfs_io_command "fpunch"
+
+echo "Create and format"
+dev=$(_get_scsi_debug_dev 512 512 0 4 "lbpws=1 lbpws10=1")
+_pwrite_byte 0x62 0 4m $dev >> $seqres.full
+
+echo "Zero punch"
+$XFS_IO_PROG -c "fpunch 512k 1m" $dev
+
+echo "Punch range past EOD"
+$XFS_IO_PROG -c "fpunch 3m 4m" $dev
+
+echo "Check contents"
+md5sum $dev | sed -e "s|$dev|SCSI_DEBUG_DEV|g"
+
+echo "Punch to EOD"
+$XFS_IO_PROG -c "fpunch 0 9223372036854775807" $dev
+
+echo "Check contents"
+md5sum $dev | sed -e "s|$dev|SCSI_DEBUG_DEV|g"
+
+echo "Destroy device"
+_put_scsi_debug_dev
+
+# success, all done
+status=0
+exit
diff --git a/tests/generic/706.out b/tests/generic/706.out
new file mode 100644
index 0000000..53a09ae
--- /dev/null
+++ b/tests/generic/706.out
@@ -0,0 +1,10 @@
+QA output created by 706
+Create and format
+Zero punch
+Punch range past EOD
+Check contents
+8c6a3fd51601141b56eaebbab3746156  SCSI_DEBUG_DEV
+Punch to EOD
+Check contents
+b5cfa9d6c8febd618f91ac2843d50a1c  SCSI_DEBUG_DEV
+Destroy device
diff --git a/tests/generic/707 b/tests/generic/707
new file mode 100755
index 0000000..fab997f
--- /dev/null
+++ b/tests/generic/707
@@ -0,0 +1,118 @@
+#! /bin/bash
+# FS QA Test No. 707
+#
+# Test the unsupported fallocate flags on a block device.  No collapse
+# or insert range, no regular fallocate, no forgetting keep-space on
+# zero range, no punching past EOD, no requests that aren't aligned
+# with the logicalsector size, and make sure the fallbacks work for
+# devices that don't support write_same or discard.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016 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.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/scsi_debug
+
+# real QA test starts here
+_supported_os Linux
+_require_scsi_debug
+_require_xfs_io_command "falloc"
+_require_xfs_io_command "finsert"
+_require_xfs_io_command "fcollapse"
+_require_xfs_io_command "fzero"
+_require_xfs_io_command "fpunch"
+
+
+echo "Create and format"
+dev=$(_get_scsi_debug_dev 4096 4096 0 4 "lbpws=1 lbpws10=1")
+_pwrite_byte 0x62 0 4m $dev >> $seqres.full
+$XFS_IO_PROG -c "fsync" $dev
+
+echo "Regular fallocate"
+$XFS_IO_PROG -c "falloc 64k 64k" $dev
+
+echo "Insert range"
+$XFS_IO_PROG -c "finsert 128k 64k" $dev
+
+echo "Collapse range"
+$XFS_IO_PROG -c "fcollapse 256k 64k" $dev
+
+echo "Unaligned zero range"
+$XFS_IO_PROG -c "fzero -k 512 512" $dev
+
+echo "Unaligned punch"
+$XFS_IO_PROG -c "fpunch 512 512" $dev
+
+echo "Zero range toobig keep size"
+$XFS_IO_PROG -c "fzero -k 512k 9223372036854775807" $dev
+
+echo "Zero range toobig"
+$XFS_IO_PROG -c "fzero 512k 9223372036854775807" $dev
+
+echo "Zero range to EOD fail w/o keepsize"
+$XFS_IO_PROG -c "fzero 0 9223372036854775807" $dev
+
+echo "Zero range starts past EOD"
+$XFS_IO_PROG -c "fzero -k 900m 1m" $dev
+
+echo "Punch starts past EOD"
+$XFS_IO_PROG -c "fpunch 900m 1m" $dev
+
+echo "Check contents"
+md5sum $dev | sed -e "s|$dev|SCSI_DEBUG_DEV|g"
+
+echo "Destroy device"
+_put_scsi_debug_dev
+
+echo "Create w/o unmap or writesame and format"
+dev=$(_get_scsi_debug_dev 512 512 0 4 "lbpws=0 lbpws10=0 lbpu=0 write_same_length=0 unmap_max_blocks=0")
+_pwrite_byte 0x62 0 4m $dev >> $seqres.full
+$XFS_IO_PROG -c "fsync" $dev
+
+echo "Zero punch, no fallback available"
+$XFS_IO_PROG -c "fpunch 512k 512k" $dev
+
+echo "Zero range, write fallback"
+$XFS_IO_PROG -c "fzero -k 1536k 512k" $dev
+
+echo "Check contents"
+md5sum $dev | sed -e "s|$dev|SCSI_DEBUG_DEV|g"
+
+echo "Destroy device"
+_put_scsi_debug_dev
+
+# success, all done
+status=0
+exit
diff --git a/tests/generic/707.out b/tests/generic/707.out
new file mode 100644
index 0000000..050c70c
--- /dev/null
+++ b/tests/generic/707.out
@@ -0,0 +1,32 @@
+QA output created by 707
+Create and format
+Regular fallocate
+fallocate: Operation not supported
+Insert range
+fallocate: Operation not supported
+Collapse range
+fallocate: Operation not supported
+Unaligned zero range
+fallocate: Invalid argument
+Unaligned punch
+fallocate: Invalid argument
+Zero range toobig keep size
+fallocate: File too large
+Zero range toobig
+fallocate: File too large
+Zero range to EOD fail w/o keepsize
+fallocate: Invalid argument
+Zero range starts past EOD
+fallocate: Invalid argument
+Punch starts past EOD
+fallocate: Invalid argument
+Check contents
+b83f9394092e15bdcda585cd8e776dc6  SCSI_DEBUG_DEV
+Destroy device
+Create w/o unmap or writesame and format
+Zero punch, no fallback available
+fallocate: Operation not supported
+Zero range, write fallback
+Check contents
+0fc6bc93cd0cd97e3cde5ea39ea1185d  SCSI_DEBUG_DEV
+Destroy device
diff --git a/tests/generic/group b/tests/generic/group
index 727648c..51a2d63 100644
--- a/tests/generic/group
+++ b/tests/generic/group
@@ -340,3 +340,6 @@
 335 auto quick metadata
 336 auto quick metadata
 337 auto quick metadata
+705 blockdev quick rw
+706 blockdev quick rw
+707 blockdev quick rw

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* Re: [PATCH 06/12] xfs/030: fix output on newer filesystems
  2016-03-05 20:20     ` Christoph Hellwig
@ 2016-03-23  3:40       ` Dave Chinner
  -1 siblings, 0 replies; 64+ messages in thread
From: Dave Chinner @ 2016-03-23  3:40 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Darrick J. Wong, linux-ext4, fstests, linux-btrfs, xfs

On Sat, Mar 05, 2016 at 12:20:50PM -0800, Christoph Hellwig wrote:
> Still fails for me:
> 
> --- tests/xfs/030.out	2016-03-03 07:55:58.556427678 +0000
> +++ /root/xfstests/results//xfs/030.out.bad	2016-03-05 20:20:17.561433837 +0000
> @@ -231,8 +231,6 @@
>  bad agbno AGBNO in agfl, agno 0
>  bad agbno AGBNO in agfl, agno 0
>  bad agbno AGBNO in agfl, agno 0
> -bad agbno AGBNO in agfl, agno 0
> -bad agbno AGBNO in agfl, agno 0

That's because the free lists are of different lengths on the
different fs configs. Not sure how best to handle it - maybe just
filter then entire bad agbno in agfl line out?

I'm going to commit the change anyway, as this is a separate issue
that needs to be solved.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH 06/12] xfs/030: fix output on newer filesystems
@ 2016-03-23  3:40       ` Dave Chinner
  0 siblings, 0 replies; 64+ messages in thread
From: Dave Chinner @ 2016-03-23  3:40 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs, linux-ext4, linux-btrfs, fstests, Darrick J. Wong

On Sat, Mar 05, 2016 at 12:20:50PM -0800, Christoph Hellwig wrote:
> Still fails for me:
> 
> --- tests/xfs/030.out	2016-03-03 07:55:58.556427678 +0000
> +++ /root/xfstests/results//xfs/030.out.bad	2016-03-05 20:20:17.561433837 +0000
> @@ -231,8 +231,6 @@
>  bad agbno AGBNO in agfl, agno 0
>  bad agbno AGBNO in agfl, agno 0
>  bad agbno AGBNO in agfl, agno 0
> -bad agbno AGBNO in agfl, agno 0
> -bad agbno AGBNO in agfl, agno 0

That's because the free lists are of different lengths on the
different fs configs. Not sure how best to handle it - maybe just
filter then entire bad agbno in agfl line out?

I'm going to commit the change anyway, as this is a separate issue
that needs to be solved.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 64+ messages in thread

end of thread, other threads:[~2016-03-23  3:41 UTC | newest]

Thread overview: 64+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-05  0:37 [PATCH v5 00/12] xfstests: minor fixes for the reflink/dedupe tests Darrick J. Wong
2016-03-05  0:37 ` Darrick J. Wong
2016-03-05  0:37 ` [PATCH 01/12] xfs/207: fix golden output to match FS_IOC_FSSETXATTR hoist Darrick J. Wong
2016-03-05  0:37   ` Darrick J. Wong
2016-03-05 20:16   ` Christoph Hellwig
2016-03-05 20:16     ` Christoph Hellwig
2016-03-05  0:37 ` [PATCH 02/12] xfs: test copy-on-write leftover recovery Darrick J. Wong
2016-03-05  0:37   ` Darrick J. Wong
2016-03-05 20:17   ` Christoph Hellwig
2016-03-05 20:17     ` Christoph Hellwig
2016-03-05  0:37 ` [PATCH 03/12] reflink: fix fragmentation tests to work on >4k block size filesystems Darrick J. Wong
2016-03-05  0:37   ` Darrick J. Wong
2016-03-05 20:17   ` Christoph Hellwig
2016-03-05 20:17     ` Christoph Hellwig
2016-03-05  0:37 ` [PATCH 04/12] xfs/23[3-6]: don't source common/xfs, it doesn't exist Darrick J. Wong
2016-03-05  0:37   ` Darrick J. Wong
2016-03-05 20:19   ` Christoph Hellwig
2016-03-05 20:19     ` Christoph Hellwig
2016-03-05  0:37 ` [PATCH 05/12] xfs/206: fix output when mkfs knows about reflink Darrick J. Wong
2016-03-05  0:37   ` Darrick J. Wong
2016-03-05 20:19   ` Christoph Hellwig
2016-03-05 20:19     ` Christoph Hellwig
2016-03-05  0:37 ` [PATCH 06/12] xfs/030: fix output on newer filesystems Darrick J. Wong
2016-03-05  0:37   ` Darrick J. Wong
2016-03-05 20:20   ` Christoph Hellwig
2016-03-05 20:20     ` Christoph Hellwig
2016-03-23  3:40     ` Dave Chinner
2016-03-23  3:40       ` Dave Chinner
2016-03-05  0:38 ` [PATCH 07/12] xfs/073: fix output Darrick J. Wong
2016-03-05  0:38   ` Darrick J. Wong
2016-03-05 20:22   ` Christoph Hellwig
2016-03-05 20:22     ` Christoph Hellwig
2016-03-05  0:38 ` [PATCH 08/12] xfs/122: define _GNU_SOURCE when compiling test program Darrick J. Wong
2016-03-05  0:38   ` Darrick J. Wong
2016-03-05 20:10   ` Christoph Hellwig
2016-03-05 20:10     ` Christoph Hellwig
2016-03-05  0:38 ` [PATCH 09/12] xfs/122: support rmapxbt Darrick J. Wong
2016-03-05  0:38   ` Darrick J. Wong
2016-03-05 20:12   ` Christoph Hellwig
2016-03-05 20:12     ` Christoph Hellwig
2016-03-05  0:38 ` [PATCH 10/12] xfs: test per-ag allocation accounting during truncate-caused refcountbt expansion Darrick J. Wong
2016-03-05  0:38   ` Darrick J. Wong
2016-03-05 20:23   ` Christoph Hellwig
2016-03-05 20:23     ` Christoph Hellwig
2016-03-05  0:38 ` [PATCH 11/12] xfs: remove NOCOW_FL testing from test Darrick J. Wong
2016-03-05  0:38   ` Darrick J. Wong
2016-03-05 20:10   ` Christoph Hellwig
2016-03-05 20:10     ` Christoph Hellwig
2016-03-05  0:38 ` [PATCH 12/12] block: test fallocate for block devices Darrick J. Wong
2016-03-05  0:38   ` Darrick J. Wong
2016-03-05 18:25   ` Christoph Hellwig
2016-03-05 18:25     ` Christoph Hellwig
2016-03-07  8:26     ` Darrick J. Wong
2016-03-07  8:26       ` Darrick J. Wong
2016-03-15  3:41     ` Dave Chinner
2016-03-15  3:41       ` Dave Chinner
2016-03-15  8:34       ` Christoph Hellwig
2016-03-15  8:34         ` Christoph Hellwig
2016-03-15 19:25   ` [PATCH v2 " Darrick J. Wong
2016-03-15 19:25     ` Darrick J. Wong
2016-03-05 20:25 ` [PATCH 13/12] xfs/209: filter scratch dir properly Christoph Hellwig
2016-03-05 20:25   ` Christoph Hellwig
2016-03-06 22:09   ` Darrick J. Wong
2016-03-06 22:09     ` Darrick J. Wong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.