All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] xfstests: fix tests for rmap/reflink
@ 2016-10-17 22:09 Darrick J. Wong
  2016-10-17 22:09 ` [PATCH 1/3] xfs: set the refcount btree cowflag when setting up cow Darrick J. Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Darrick J. Wong @ 2016-10-17 22:09 UTC (permalink / raw)
  To: david, eguan, darrick.wong; +Cc: linux-xfs, hch, fstests

Hi all,

Here are some cleanups[1] for the rmap/reflink tests to reflect recent
API changes (the readdition of the unshare fallocate flag and the
removal of the reflink inode flag), a last-minute disk format change
for the XFS reflink implementation, and some cleanups that were left
out of the previous patch submission.

--D

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

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

* [PATCH 1/3] xfs: set the refcount btree cowflag when setting up cow
  2016-10-17 22:09 [PATCH v2 0/3] xfstests: fix tests for rmap/reflink Darrick J. Wong
@ 2016-10-17 22:09 ` Darrick J. Wong
  2016-10-17 22:09 ` [PATCH 2/3] misc: fix fallocate commands that need the unshare switch Darrick J. Wong
  2016-10-17 22:09 ` [PATCH 3/3] misc: fix more xfs_db open-coding instances Darrick J. Wong
  2 siblings, 0 replies; 11+ messages in thread
From: Darrick J. Wong @ 2016-10-17 22:09 UTC (permalink / raw)
  To: david, eguan, darrick.wong; +Cc: linux-xfs, hch, Christoph Hellwig, fstests

When we're setting up a fake cow extent in the refcountbt to test
cleanup of fake cow extents, set the cowflag in the record field
to reflect our new disk format of storing the staging extents in
the right side of the tree.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 tests/xfs/307 |    1 +
 tests/xfs/308 |    1 +
 2 files changed, 2 insertions(+)


diff --git a/tests/xfs/307 b/tests/xfs/307
index 869f5cc..2a99459 100755
--- a/tests/xfs/307
+++ b/tests/xfs/307
@@ -145,6 +145,7 @@ _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'
+_set_agf_data "recs[1].cowflag" 1 -c 'addr refcntroot'
 
 if [ $is_rmap -gt 0 ]; then
 	rmap_nr=$((rmap_nr + 1))
diff --git a/tests/xfs/308 b/tests/xfs/308
index 8f8f380..5bfa432 100755
--- a/tests/xfs/308
+++ b/tests/xfs/308
@@ -145,6 +145,7 @@ _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'
+_set_agf_data "recs[1].cowflag" 1 -c 'addr refcntroot'
 
 if [ $is_rmap -gt 0 ]; then
 	rmap_nr=$((rmap_nr + 1))


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

* [PATCH 2/3] misc: fix fallocate commands that need the unshare switch
  2016-10-17 22:09 [PATCH v2 0/3] xfstests: fix tests for rmap/reflink Darrick J. Wong
  2016-10-17 22:09 ` [PATCH 1/3] xfs: set the refcount btree cowflag when setting up cow Darrick J. Wong
@ 2016-10-17 22:09 ` Darrick J. Wong
  2016-10-18  5:19   ` Christoph Hellwig
  2016-10-17 22:09 ` [PATCH 3/3] misc: fix more xfs_db open-coding instances Darrick J. Wong
  2 siblings, 1 reply; 11+ messages in thread
From: Darrick J. Wong @ 2016-10-17 22:09 UTC (permalink / raw)
  To: david, eguan, darrick.wong; +Cc: linux-xfs, hch, fstests

We re-added the UNSHARE flag to fallocate, so go make sure that all
the unshare tests actually check that the installed copy of xfs_io
supports the 'funshare' command and that the underlying filesystem
understands the flag, and change the tests themselves to use
funshare.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 common/rc         |    2 +-
 tests/generic/156 |   16 ++++++----------
 tests/generic/264 |    4 ++--
 tests/xfs/132     |   12 ++++++------
 tests/xfs/184     |    3 ++-
 tests/xfs/192     |    3 ++-
 tests/xfs/200     |    3 ++-
 tests/xfs/204     |    3 ++-
 tests/xfs/344     |    3 ++-
 tests/xfs/345     |    3 ++-
 tests/xfs/346     |    3 ++-
 tests/xfs/347     |    3 ++-
 12 files changed, 31 insertions(+), 27 deletions(-)


diff --git a/common/rc b/common/rc
index 53f5560..86cb41c 100644
--- a/common/rc
+++ b/common/rc
@@ -2042,7 +2042,7 @@ _require_xfs_io_command()
 	"falloc" )
 		testio=`$XFS_IO_PROG -F -f -c "falloc 0 1m" $testfile 2>&1`
 		;;
-	"fpunch" | "fcollapse" | "zero" | "fzero" | "finsert" )
+	"fpunch" | "fcollapse" | "zero" | "fzero" | "finsert" | "funshare")
 		testio=`$XFS_IO_PROG -F -f -c "pwrite 0 20k" -c "fsync" \
 			-c "$command 4k 8k" $testfile 2>&1`
 		;;
diff --git a/tests/generic/156 b/tests/generic/156
index 9e22a02..e062b56 100755
--- a/tests/generic/156
+++ b/tests/generic/156
@@ -54,15 +54,11 @@ _cleanup()
 . ./common/attr
 . ./common/reflink
 
-if [ $FSTYP = "btrfs" ]; then
-	_notrun "btrfs doesn't handle unshare on fallocate"
-fi
-
 # real QA test starts here
 _supported_os Linux
 _require_test_reflink
 _require_cp_reflink
-_require_xfs_io_command "falloc"
+_require_xfs_io_command "funshare"
 
 rm -f $seqres.full
 
@@ -89,18 +85,18 @@ _test_cycle_mount
 free_blocks1=$(stat -f $testdir -c '%f')
 
 echo "funshare part of a file"
-$XFS_IO_PROG -f -c "falloc 0 $((sz / 2))" $testdir/file2
+$XFS_IO_PROG -f -c "funshare 0 $((sz / 2))" $testdir/file2
 _test_cycle_mount
 
 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
+$XFS_IO_PROG -f -c "funshare 0 $sz" $testdir/file2
+$XFS_IO_PROG -f -c "funshare 0 $sz" $testdir/file3
 _test_cycle_mount
 free_blocks2=$(stat -f $testdir -c '%f')
 
 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
+$XFS_IO_PROG -f -c "funshare 0 $sz" $testdir/file4
+$XFS_IO_PROG -f -c "funshare 0 $sz" $testdir/file1
 _test_cycle_mount
 free_blocks3=$(stat -f $testdir -c '%f')
 
diff --git a/tests/generic/264 b/tests/generic/264
index 631184c..f90de03 100755
--- a/tests/generic/264
+++ b/tests/generic/264
@@ -47,7 +47,7 @@ _cleanup()
 _supported_os Linux
 _require_scratch_reflink
 _require_cp_reflink
-_require_xfs_io_command "falloc"
+_require_xfs_io_command "funshare"
 
 rm -f $seqres.full
 
@@ -75,7 +75,7 @@ md5sum $testdir/file2 | _filter_scratch
 md5sum $testdir/file2.chk | _filter_scratch
 
 echo "CoW and unmount"
-$XFS_IO_PROG -f -c "pwrite -S 0x62 -b $((blksz * 3)) $blksz $((blksz * 3))" -c "falloc $((blksz * 2)) $blksz" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "pwrite -S 0x62 -b $((blksz * 3)) $blksz $((blksz * 3))" -c "funshare $((blksz * 2)) $blksz" $testdir/file2 >> $seqres.full
 _scratch_cycle_mount
 $XFS_IO_PROG -f -c "pwrite -S 0x62 -b $((blksz * 3)) $blksz $((blksz * 3))" $testdir/file2.chk >> $seqres.full
 _scratch_cycle_mount
diff --git a/tests/xfs/132 b/tests/xfs/132
index 7f7ebaa..ac8dc25 100755
--- a/tests/xfs/132
+++ b/tests/xfs/132
@@ -63,7 +63,7 @@ _supported_os Linux
 _require_test_reflink
 _require_test_lsattr
 _require_cp_reflink
-_require_xfs_io_command "falloc"
+_require_xfs_io_command "funshare"
 
 rm -f $seqres.full
 
@@ -90,18 +90,18 @@ _test_cycle_mount
 free_blocks1=$(stat -f $testdir -c '%f')
 
 echo "funshare part of a file"
-$XFS_IO_PROG -f -c "falloc 0 $((sz / 2))" $testdir/file2
+$XFS_IO_PROG -f -c "funshare 0 $((sz / 2))" $testdir/file2
 _test_cycle_mount
 
 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
+$XFS_IO_PROG -f -c "funshare 0 $sz" $testdir/file2
+$XFS_IO_PROG -f -c "funshare 0 $sz" $testdir/file3
 _test_cycle_mount
 free_blocks2=$(stat -f $testdir -c '%f')
 
 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
+$XFS_IO_PROG -f -c "funshare 0 $sz" $testdir/file4
+$XFS_IO_PROG -f -c "funshare 0 $sz" $testdir/file1
 _test_cycle_mount
 free_blocks3=$(stat -f $testdir -c '%f')
 
diff --git a/tests/xfs/184 b/tests/xfs/184
index e843b4e..0860701 100755
--- a/tests/xfs/184
+++ b/tests/xfs/184
@@ -51,6 +51,7 @@ _require_scratch_reflink
 _require_cp_reflink
 _require_fiemap
 _require_xfs_io_command "cowextsize"
+_require_xfs_io_command "funshare"
 
 rm -f $seqres.full
 
@@ -84,7 +85,7 @@ md5sum $testdir/file2 | _filter_scratch
 echo "CoW and unmount"
 $XFS_IO_PROG -f -c "cowextsize" $testdir/file2 >> $seqres.full
 $XFS_IO_PROG -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((filesize + 1))" -c "fdatasync" $testdir/file2 >> $seqres.full
-$XFS_IO_PROG -f -c "falloc 0 $((filesize + 1))" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "funshare 0 $((filesize + 1))" $testdir/file2 >> $seqres.full
 _scratch_cycle_mount
 
 echo "Compare files"
diff --git a/tests/xfs/192 b/tests/xfs/192
index 01f5e1c..e56c860 100755
--- a/tests/xfs/192
+++ b/tests/xfs/192
@@ -51,6 +51,7 @@ _require_scratch_reflink
 _require_cp_reflink
 _require_fiemap
 _require_xfs_io_command "cowextsize"
+_require_xfs_io_command "funshare"
 _require_odirect
 
 rm -f $seqres.full
@@ -85,7 +86,7 @@ md5sum $testdir/file2 | _filter_scratch
 echo "CoW and unmount"
 $XFS_IO_PROG -f -c "cowextsize" $testdir/file2 >> $seqres.full
 $XFS_IO_PROG -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $filesize" $testdir/file2 >> $seqres.full
-$XFS_IO_PROG -d -f -c "falloc 0 $filesize" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -d -f -c "funshare 0 $filesize" $testdir/file2 >> $seqres.full
 _scratch_cycle_mount
 
 echo "Compare files"
diff --git a/tests/xfs/200 b/tests/xfs/200
index ebb6e73..d4363a4 100755
--- a/tests/xfs/200
+++ b/tests/xfs/200
@@ -53,6 +53,7 @@ _require_scratch_reflink
 _require_cp_reflink
 _require_fiemap
 _require_xfs_io_command "cowextsize"
+_require_xfs_io_command "funshare"
 
 rm -f $seqres.full
 
@@ -88,7 +89,7 @@ $XFS_IO_PROG -f -c "cowextsize" $testdir/file2 >> $seqres.full
 cat $testdir/file2 > /dev/null
 $XFS_IO_PROG -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $filesize" -c "fdatasync" $testdir/file2 >> $seqres.full
 $XFS_IO_PROG -f -c "fadvise -d 0 $filesize" -c "fsync" $testdir/file2 >> $seqres.full
-$XFS_IO_PROG -f -c "falloc 0 $filesize" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "funshare 0 $filesize" $testdir/file2 >> $seqres.full
 _scratch_cycle_mount
 
 echo "Compare files"
diff --git a/tests/xfs/204 b/tests/xfs/204
index 6e5b896..3dbaf95 100755
--- a/tests/xfs/204
+++ b/tests/xfs/204
@@ -53,6 +53,7 @@ _require_scratch_reflink
 _require_cp_reflink
 _require_fiemap
 _require_xfs_io_command "cowextsize"
+_require_xfs_io_command "funshare"
 _require_odirect
 
 rm -f $seqres.full
@@ -89,7 +90,7 @@ $XFS_IO_PROG -f -c "cowextsize" $testdir/file2 >> $seqres.full
 cat $testdir/file2 > /dev/null
 $XFS_IO_PROG -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $filesize" -c "fdatasync" $testdir/file2 >> $seqres.full
 $XFS_IO_PROG -f -c "fadvise -d 0 $filesize" -c "fsync" $testdir/file2 >> $seqres.full
-$XFS_IO_PROG -f -c "falloc 0 $filesize" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "funshare 0 $filesize" $testdir/file2 >> $seqres.full
 _scratch_cycle_mount
 
 echo "Compare files"
diff --git a/tests/xfs/344 b/tests/xfs/344
index 25bff1a..229e22a 100755
--- a/tests/xfs/344
+++ b/tests/xfs/344
@@ -51,6 +51,7 @@ _require_scratch_reflink
 _require_cp_reflink
 _require_fiemap
 _require_xfs_io_command "cowextsize"
+_require_xfs_io_command "funshare"
 _require_odirect
 
 rm -f $seqres.full
@@ -85,7 +86,7 @@ md5sum $testdir/file2 | _filter_scratch
 echo "CoW and unmount"
 $XFS_IO_PROG -f -c "cowextsize" $testdir/file2 >> $seqres.full
 $XFS_IO_PROG -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $filesize" $testdir/file2 >> $seqres.full
-$XFS_IO_PROG -d -f -c "falloc -u 0 $filesize" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -d -f -c "funshare 0 $filesize" $testdir/file2 >> $seqres.full
 _scratch_cycle_mount
 
 echo "Compare files"
diff --git a/tests/xfs/345 b/tests/xfs/345
index edb4443..4e31324 100755
--- a/tests/xfs/345
+++ b/tests/xfs/345
@@ -50,6 +50,7 @@ _require_scratch_reflink
 _require_cp_reflink
 _require_fiemap
 _require_xfs_io_command "cowextsize"
+_require_xfs_io_command "funshare"
 
 rm -f $seqres.full
 
@@ -83,7 +84,7 @@ md5sum $testdir/file2 | _filter_scratch
 echo "CoW and unmount"
 $XFS_IO_PROG -f -c "cowextsize" $testdir/file2 >> $seqres.full
 $XFS_IO_PROG -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $filesize" -c "fdatasync" $testdir/file2 >> $seqres.full
-$XFS_IO_PROG -f -c "falloc -u 0 $filesize" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "funshare 0 $filesize" $testdir/file2 >> $seqres.full
 _scratch_cycle_mount
 
 echo "Compare files"
diff --git a/tests/xfs/346 b/tests/xfs/346
index d0463eb..7d7075a 100755
--- a/tests/xfs/346
+++ b/tests/xfs/346
@@ -51,6 +51,7 @@ _require_scratch_reflink
 _require_cp_reflink
 _require_fiemap
 _require_xfs_io_command "cowextsize"
+_require_xfs_io_command "funshare"
 _require_odirect
 
 rm -f $seqres.full
@@ -88,7 +89,7 @@ seq 1 10 | while read i; do
 	$XFS_IO_PROG -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $filesize" $testdir/file2 >> $seqres.full
 	_scratch_cycle_mount
 done
-$XFS_IO_PROG -f -c "falloc -u 0 $filesize" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "funshare 0 $filesize" $testdir/file2 >> $seqres.full
 _scratch_cycle_mount
 
 echo "Compare files"
diff --git a/tests/xfs/347 b/tests/xfs/347
index 1578216..e4f9635 100755
--- a/tests/xfs/347
+++ b/tests/xfs/347
@@ -51,6 +51,7 @@ _require_scratch_reflink
 _require_cp_reflink
 _require_fiemap
 _require_xfs_io_command "cowextsize"
+_require_xfs_io_command "funshare"
 
 rm -f $seqres.full
 
@@ -87,7 +88,7 @@ seq 1 10 | while read i; do
 	$XFS_IO_PROG -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $filesize" $testdir/file2 >> $seqres.full
 	_scratch_cycle_mount
 done
-$XFS_IO_PROG -f -c "falloc -u 0 $filesize" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "funshare 0 $filesize" $testdir/file2 >> $seqres.full
 _scratch_cycle_mount
 
 echo "Compare files"


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

* [PATCH 3/3] misc: fix more xfs_db open-coding instances
  2016-10-17 22:09 [PATCH v2 0/3] xfstests: fix tests for rmap/reflink Darrick J. Wong
  2016-10-17 22:09 ` [PATCH 1/3] xfs: set the refcount btree cowflag when setting up cow Darrick J. Wong
  2016-10-17 22:09 ` [PATCH 2/3] misc: fix fallocate commands that need the unshare switch Darrick J. Wong
@ 2016-10-17 22:09 ` Darrick J. Wong
  2016-10-20 14:44   ` Eryu Guan
  2 siblings, 1 reply; 11+ messages in thread
From: Darrick J. Wong @ 2016-10-17 22:09 UTC (permalink / raw)
  To: david, eguan, darrick.wong; +Cc: linux-xfs, hch, Christoph Hellwig, fstests

Convert some more cases of 'xfs_db $SCRATCH_DEV' to _scratch_xfs_db
that were left out of the initial cleanup patch.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 tests/xfs/004 |    2 +-
 tests/xfs/007 |    8 ++++----
 tests/xfs/021 |    4 ++--
 tests/xfs/044 |    2 +-
 tests/xfs/052 |    2 +-
 tests/xfs/116 |    4 ++--
 tests/xfs/136 |    6 +++---
 tests/xfs/199 |    6 +++---
 tests/xfs/278 |   16 ++++++++--------
 tests/xfs/291 |    2 +-
 tests/xfs/307 |   20 ++++++++++----------
 tests/xfs/308 |   20 ++++++++++----------
 12 files changed, 46 insertions(+), 46 deletions(-)


diff --git a/tests/xfs/004 b/tests/xfs/004
index 59b8997..09da2fe 100755
--- a/tests/xfs/004
+++ b/tests/xfs/004
@@ -74,7 +74,7 @@ eval `$DF_PROG $SCRATCH_MNT 2>&1 \
 echo "df gave: blocks=$blocks used=$used avail=$avail" >>$seqres.full
 echo "blocksize from mkfs is '$dbsize'" >>$seqres.full
 
-xfs_db -r -c "freesp -s" $SCRATCH_DEV >$tmp.xfs_db
+_scratch_xfs_db -r -c "freesp -s"  >$tmp.xfs_db
 echo "xfs_db for $SCRATCH_DEV" >>$seqres.full
 cat $tmp.xfs_db >>$seqres.full
 
diff --git a/tests/xfs/007 b/tests/xfs/007
index f2e3584..eb2c9b3 100755
--- a/tests/xfs/007
+++ b/tests/xfs/007
@@ -68,8 +68,8 @@ do_test()
 			grep $qino_2 | awk '{print $NF}'`
 
 	echo "*** Usage before quotarm ***"
-	xfs_db -c "inode $QINO_1" -c "p core.nblocks" $SCRATCH_DEV
-	xfs_db -c "inode $QINO_2" -c "p core.nblocks" $SCRATCH_DEV
+	_scratch_xfs_db -c "inode $QINO_1" -c "p core.nblocks" 
+	_scratch_xfs_db -c "inode $QINO_2" -c "p core.nblocks" 
 
 	_qmount
 	echo "*** turn off $off_opts quotas"
@@ -79,8 +79,8 @@ do_test()
 	_scratch_unmount
 
 	echo "*** Usage after quotarm ***"
-	xfs_db -c "inode $QINO_1" -c "p core.nblocks" $SCRATCH_DEV
-	xfs_db -c "inode $QINO_2" -c "p core.nblocks" $SCRATCH_DEV
+	_scratch_xfs_db -c "inode $QINO_1" -c "p core.nblocks" 
+	_scratch_xfs_db -c "inode $QINO_2" -c "p core.nblocks" 
 }
 
 
diff --git a/tests/xfs/021 b/tests/xfs/021
index 795b71c..67a4346 100755
--- a/tests/xfs/021
+++ b/tests/xfs/021
@@ -130,14 +130,14 @@ _scratch_unmount >>$seqres.full 2>&1 \
 
 echo "*** dump attributes (1)"
 
-xfs_db -r -c "inode $inum_1" -c "print a.sfattr" $SCRATCH_DEV | \
+_scratch_xfs_db -r -c "inode $inum_1" -c "print a.sfattr"  | \
 	sed -e '/secure = /d' | sed -e '/parent = /d'
 
 echo "*** dump attributes (2)"
 
 # There is a fair bit of filtering here to convert v5 filesystem output
 # into the v4 format that holds the meaningful information for the test.
-xfs_db -r -c "inode $inum_2" -c "a a.bmx[0].startblock" -c print $SCRATCH_DEV \
+_scratch_xfs_db -r -c "inode $inum_2" -c "a a.bmx[0].startblock" -c print  \
 	| perl -ne '
 s/,secure//;
 s/,parent//;
diff --git a/tests/xfs/044 b/tests/xfs/044
index ea58c07..fc5dae0 100755
--- a/tests/xfs/044
+++ b/tests/xfs/044
@@ -130,7 +130,7 @@ _check_mount
 _check_require_logdev
 
 echo "*** set uuid"
-xfs_db -x $SCRATCH_DEV -l $SCRATCH_LOGDEV -c "uuid 02020202-0202-0202-0202-020202020202"
+_scratch_xfs_db -x  -l $SCRATCH_LOGDEV -c "uuid 02020202-0202-0202-0202-020202020202"
 [ $? -ne 0 ] && _unexpected
 _check_mount
 
diff --git a/tests/xfs/052 b/tests/xfs/052
index 18cf037..56231f3 100755
--- a/tests/xfs/052
+++ b/tests/xfs/052
@@ -110,7 +110,7 @@ cat $tmp.quota >> $seqres.full
 _scratch_unmount
 
 # note - does (insitu) conversion from fs blocks to 1K blocks
-xfs_db -rc "dquot -$type $id" -c p $SCRATCH_DEV | tee -a $seqres.full | perl -ne '
+_scratch_xfs_db -rc "dquot -$type $id" -c p  | tee -a $seqres.full | perl -ne '
 	if (/^diskdq.bcount = (\d+)$/) {
 		 print "used_blocks=", $1 * '$dbsize' / 1024, "\n";
 	}
diff --git a/tests/xfs/116 b/tests/xfs/116
index 2dabde9..1d13d15 100755
--- a/tests/xfs/116
+++ b/tests/xfs/116
@@ -55,10 +55,10 @@ _require_xfs_quota
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount "-o uquota"
 _scratch_unmount
-xfs_db -r -c sb -c print $SCRATCH_DEV | grep qflags
+_scratch_xfs_db -r -c sb -c print  | grep qflags
 _scratch_mount
 _scratch_unmount
-xfs_db -r -c sb -c print $SCRATCH_DEV | grep qflags
+_scratch_xfs_db -r -c sb -c print  | grep qflags
 
 # success, all done
 status=0
diff --git a/tests/xfs/136 b/tests/xfs/136
index 679fa9f..6256215 100755
--- a/tests/xfs/136
+++ b/tests/xfs/136
@@ -103,7 +103,7 @@ do_extents()
 _print_inode()
 {
     _scratch_unmount
-    xfs_db -r -c "inode $inum" -c "print" $SCRATCH_DEV |\
+    _scratch_xfs_db -r -c "inode $inum" -c "print"  |\
     awk '
 	/nextents/ { print; next }
 	/naextents/ { print; next }
@@ -119,14 +119,14 @@ _print_inode()
 _print_inode_u()
 {
     _scratch_unmount
-    xfs_db -r -c "inode $inum" -c "print u" $SCRATCH_DEV
+    _scratch_xfs_db -r -c "inode $inum" -c "print u" 
     _scratch_mount
 }
 
 _print_inode_a()
 {
     _scratch_unmount
-    xfs_db -r -c "inode $inum" -c "print a" $SCRATCH_DEV
+    _scratch_xfs_db -r -c "inode $inum" -c "print a" 
     _scratch_mount
 }
 
diff --git a/tests/xfs/199 b/tests/xfs/199
index 3133893..ee26439 100755
--- a/tests/xfs/199
+++ b/tests/xfs/199
@@ -51,7 +51,7 @@ _require_scratch
 
 get_features()
 {
-	xfs_db -x $SCRATCH_DEV -c "sb" -c "print $1" | awk '// {print $3}'
+	_scratch_xfs_db -x  -c "sb" -c "print $1" | awk '// {print $3}'
 }
 
 # clear any mkfs options so that we can directly specify the options we need to
@@ -70,7 +70,7 @@ bf2=`get_features bad_features2`
 # Now clear the normal flags
 #
 echo "Clearing features2:"
-xfs_db -x $SCRATCH_DEV -c 'sb' -c 'write features2 0'
+_scratch_xfs_db -x  -c 'sb' -c 'write features2 0'
 
 _scratch_mount
 _scratch_unmount
@@ -80,7 +80,7 @@ rwf2=`get_features features2`
 # Clear the normal flags again for the second rount.
 #
 echo "Clearing features2:"
-xfs_db -x $SCRATCH_DEV -c 'sb' -c 'write features2 0'
+_scratch_xfs_db -x  -c 'sb' -c 'write features2 0'
 
 #
 # And print the flags after a mount ro and remount rw
diff --git a/tests/xfs/278 b/tests/xfs/278
index caf2622..b94ee9c 100755
--- a/tests/xfs/278
+++ b/tests/xfs/278
@@ -62,16 +62,16 @@ _scratch_unmount
 echo "Silence is goodness..."
 
 # Corrupt DIR
-xfs_db -x -c "inode $DIR_INO" -c "write u.sfdir2.list[0].inumber.i4 0" $SCRATCH_DEV >> $seqres.full
-xfs_db -x -c "inode $DIR_INO" -c "write u.sfdir2.list[0].name 0" $SCRATCH_DEV >> $seqres.full
-xfs_db -x -c "inode $DIR_INO" -c "write u.sfdir2.list[0].offset 0" $SCRATCH_DEV >> $seqres.full
-xfs_db -x -c "inode $DIR_INO" -c "write u.sfdir2.list[0].namelen 0" $SCRATCH_DEV >> $seqres.full
-xfs_db -x -c "inode $DIR_INO" -c "write u.sfdir2.hdr.parent.i4 0" $SCRATCH_DEV >> $seqres.full
-xfs_db -x -c "inode $DIR_INO" -c "write core.nlinkv2 0" $SCRATCH_DEV >> $seqres.full
+_scratch_xfs_db -x -c "inode $DIR_INO" -c "write u.sfdir2.list[0].inumber.i4 0"  >> $seqres.full
+_scratch_xfs_db -x -c "inode $DIR_INO" -c "write u.sfdir2.list[0].name 0"  >> $seqres.full
+_scratch_xfs_db -x -c "inode $DIR_INO" -c "write u.sfdir2.list[0].offset 0"  >> $seqres.full
+_scratch_xfs_db -x -c "inode $DIR_INO" -c "write u.sfdir2.list[0].namelen 0"  >> $seqres.full
+_scratch_xfs_db -x -c "inode $DIR_INO" -c "write u.sfdir2.hdr.parent.i4 0"  >> $seqres.full
+_scratch_xfs_db -x -c "inode $DIR_INO" -c "write core.nlinkv2 0"  >> $seqres.full
 
 # Corrupt SUBDIR
-xfs_db -x -c "inode $SUBDIR_INO" -c "write u.sfdir2.hdr.parent.i4 0" $SCRATCH_DEV >> $seqres.full
-xfs_db -x -c "inode $SUBDIR_INO" -c "write core.nlinkv2 0" $SCRATCH_DEV >> $seqres.full
+_scratch_xfs_db -x -c "inode $SUBDIR_INO" -c "write u.sfdir2.hdr.parent.i4 0"  >> $seqres.full
+_scratch_xfs_db -x -c "inode $SUBDIR_INO" -c "write core.nlinkv2 0"  >> $seqres.full
 
 echo "===== BEGIN of xfs_repair =====" >> $seqres.full
 echo "" >>$seqres.full
diff --git a/tests/xfs/291 b/tests/xfs/291
index c226e65..808f333 100755
--- a/tests/xfs/291
+++ b/tests/xfs/291
@@ -73,7 +73,7 @@ xfs_io -f -c "pwrite 0 16m" -c "fsync" $SCRATCH_MNT/space_file.large >> $seqres.
 
 # Take a look at freespace for any post-mortem on the test
 _scratch_unmount
-xfs_db -r -c freesp $SCRATCH_DEV >> $seqres.full 2>&1
+_scratch_xfs_db -r -c freesp  >> $seqres.full 2>&1
 _scratch_mount
 
 # Step 2: Make a bunch of (hopefully fragmented) multiblock
diff --git a/tests/xfs/307 b/tests/xfs/307
index 2a99459..427d2fe 100755
--- a/tests/xfs/307
+++ b/tests/xfs/307
@@ -59,7 +59,7 @@ _get_agf_data() {
 	field="$1"
 	shift
 
-	xfs_db -c 'agf 1' "$@" -c "p $field" $SCRATCH_DEV | awk '{print $3}'
+	_scratch_xfs_db -c 'agf 1' "$@" -c "p $field"  | awk '{print $3}'
 }
 
 _set_agf_data() {
@@ -67,14 +67,14 @@ _set_agf_data() {
 	value="$2"
 	shift; shift
 
-	xfs_db -x -c 'agf 1' "$@" -c "write $field -- $value" $SCRATCH_DEV >> $seqres.full
+	_scratch_xfs_db -x -c 'agf 1' "$@" -c "write $field -- $value"  >> $seqres.full
 }
 
 _get_sb_data() {
 	field="$1"
 	shift
 
-	xfs_db -c 'sb 0' "$@" -c "p $field" $SCRATCH_DEV | awk '{print $3}'
+	_scratch_xfs_db -c 'sb 0' "$@" -c "p $field"  | awk '{print $3}'
 }
 
 _set_sb_data() {
@@ -82,7 +82,7 @@ _set_sb_data() {
 	value="$2"
 	shift; shift
 
-	xfs_db -x -c 'sb 0' "$@" -c "write $field -- $value" $SCRATCH_DEV >> $seqres.full
+	_scratch_xfs_db -x -c 'sb 0' "$@" -c "write $field -- $value"  >> $seqres.full
 }
 
 _filter_leftover() {
@@ -91,17 +91,17 @@ _filter_leftover() {
 
 _dump_status() {
 	echo "** " "$@"
-	xfs_db -c 'sb 0' -c p $SCRATCH_DEV
+	_scratch_xfs_db -c 'sb 0' -c p 
 	echo "** agf header"
-	xfs_db -c 'agf 1' -c p $SCRATCH_DEV
+	_scratch_xfs_db -c 'agf 1' -c p 
 	echo "** refcntbt"
-	xfs_db -c 'agf 1' -c 'addr refcntroot' -c p $SCRATCH_DEV
+	_scratch_xfs_db -c 'agf 1' -c 'addr refcntroot' -c p 
 	echo "** rmapbt"
-	test $is_rmap -gt 0 && xfs_db -c 'agf 1' -c 'addr rmaproot' -c p $SCRATCH_DEV
+	test $is_rmap -gt 0 && _scratch_xfs_db -c 'agf 1' -c 'addr rmaproot' -c p 
 	echo "** bnobt"
-	xfs_db -c 'agf 1' -c 'addr bnoroot' -c p $SCRATCH_DEV
+	_scratch_xfs_db -c 'agf 1' -c 'addr bnoroot' -c p 
 	echo "** cntbt"
-	xfs_db -c 'agf 1' -c 'addr cntroot' -c p $SCRATCH_DEV
+	_scratch_xfs_db -c 'agf 1' -c 'addr cntroot' -c p 
 }
 
 echo "We need AG1 to have a single free extent"
diff --git a/tests/xfs/308 b/tests/xfs/308
index 5bfa432..e14586d 100755
--- a/tests/xfs/308
+++ b/tests/xfs/308
@@ -59,7 +59,7 @@ _get_agf_data() {
 	field="$1"
 	shift
 
-	xfs_db -c 'agf 1' "$@" -c "p $field" $SCRATCH_DEV | awk '{print $3}'
+	_scratch_xfs_db -c 'agf 1' "$@" -c "p $field"  | awk '{print $3}'
 }
 
 _set_agf_data() {
@@ -67,14 +67,14 @@ _set_agf_data() {
 	value="$2"
 	shift; shift
 
-	xfs_db -x -c 'agf 1' "$@" -c "write $field -- $value" $SCRATCH_DEV >> $seqres.full
+	_scratch_xfs_db -x -c 'agf 1' "$@" -c "write $field -- $value"  >> $seqres.full
 }
 
 _get_sb_data() {
 	field="$1"
 	shift
 
-	xfs_db -c 'sb 0' "$@" -c "p $field" $SCRATCH_DEV | awk '{print $3}'
+	_scratch_xfs_db -c 'sb 0' "$@" -c "p $field"  | awk '{print $3}'
 }
 
 _set_sb_data() {
@@ -82,7 +82,7 @@ _set_sb_data() {
 	value="$2"
 	shift; shift
 
-	xfs_db -x -c 'sb 0' "$@" -c "write $field -- $value" $SCRATCH_DEV >> $seqres.full
+	_scratch_xfs_db -x -c 'sb 0' "$@" -c "write $field -- $value"  >> $seqres.full
 }
 
 _filter_leftover() {
@@ -91,17 +91,17 @@ _filter_leftover() {
 
 _dump_status() {
 	echo "** " "$@"
-	xfs_db -c 'sb 0' -c p $SCRATCH_DEV
+	_scratch_xfs_db -c 'sb 0' -c p 
 	echo "** agf header"
-	xfs_db -c 'agf 1' -c p $SCRATCH_DEV
+	_scratch_xfs_db -c 'agf 1' -c p 
 	echo "** refcntbt"
-	xfs_db -c 'agf 1' -c 'addr refcntroot' -c p $SCRATCH_DEV
+	_scratch_xfs_db -c 'agf 1' -c 'addr refcntroot' -c p 
 	echo "** rmapbt"
-	test $is_rmap -gt 0 && xfs_db -c 'agf 1' -c 'addr rmaproot' -c p $SCRATCH_DEV
+	test $is_rmap -gt 0 && _scratch_xfs_db -c 'agf 1' -c 'addr rmaproot' -c p 
 	echo "** bnobt"
-	xfs_db -c 'agf 1' -c 'addr bnoroot' -c p $SCRATCH_DEV
+	_scratch_xfs_db -c 'agf 1' -c 'addr bnoroot' -c p 
 	echo "** cntbt"
-	xfs_db -c 'agf 1' -c 'addr cntroot' -c p $SCRATCH_DEV
+	_scratch_xfs_db -c 'agf 1' -c 'addr cntroot' -c p 
 }
 
 echo "We need AG1 to have a single free extent"


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

* Re: [PATCH 2/3] misc: fix fallocate commands that need the unshare switch
  2016-10-17 22:09 ` [PATCH 2/3] misc: fix fallocate commands that need the unshare switch Darrick J. Wong
@ 2016-10-18  5:19   ` Christoph Hellwig
  0 siblings, 0 replies; 11+ messages in thread
From: Christoph Hellwig @ 2016-10-18  5:19 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: david, eguan, linux-xfs, hch, fstests

On Mon, Oct 17, 2016 at 03:09:28PM -0700, Darrick J. Wong wrote:
> We re-added the UNSHARE flag to fallocate, so go make sure that all
> the unshare tests actually check that the installed copy of xfs_io
> supports the 'funshare' command and that the underlying filesystem
> understands the flag, and change the tests themselves to use
> funshare.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Looks fine, and tests fine on XFS, btrfs and ext4:

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

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

* Re: [PATCH 3/3] misc: fix more xfs_db open-coding instances
  2016-10-17 22:09 ` [PATCH 3/3] misc: fix more xfs_db open-coding instances Darrick J. Wong
@ 2016-10-20 14:44   ` Eryu Guan
  2016-10-21  3:21     ` Darrick J. Wong
  0 siblings, 1 reply; 11+ messages in thread
From: Eryu Guan @ 2016-10-20 14:44 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: david, linux-xfs, hch, Christoph Hellwig, fstests

On Mon, Oct 17, 2016 at 03:09:34PM -0700, Darrick J. Wong wrote:
> Convert some more cases of 'xfs_db $SCRATCH_DEV' to _scratch_xfs_db
> that were left out of the initial cleanup patch.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> ---
>  tests/xfs/004 |    2 +-
>  tests/xfs/007 |    8 ++++----
>  tests/xfs/021 |    4 ++--
>  tests/xfs/044 |    2 +-
>  tests/xfs/052 |    2 +-
>  tests/xfs/116 |    4 ++--
>  tests/xfs/136 |    6 +++---
>  tests/xfs/199 |    6 +++---
>  tests/xfs/278 |   16 ++++++++--------
>  tests/xfs/291 |    2 +-
>  tests/xfs/307 |   20 ++++++++++----------
>  tests/xfs/308 |   20 ++++++++++----------
>  12 files changed, 46 insertions(+), 46 deletions(-)
> 
> 
> diff --git a/tests/xfs/004 b/tests/xfs/004
> index 59b8997..09da2fe 100755
> --- a/tests/xfs/004
> +++ b/tests/xfs/004
> @@ -74,7 +74,7 @@ eval `$DF_PROG $SCRATCH_MNT 2>&1 \
>  echo "df gave: blocks=$blocks used=$used avail=$avail" >>$seqres.full
>  echo "blocksize from mkfs is '$dbsize'" >>$seqres.full
>  
> -xfs_db -r -c "freesp -s" $SCRATCH_DEV >$tmp.xfs_db
> +_scratch_xfs_db -r -c "freesp -s"  >$tmp.xfs_db
>  echo "xfs_db for $SCRATCH_DEV" >>$seqres.full
>  cat $tmp.xfs_db >>$seqres.full
>  
> diff --git a/tests/xfs/007 b/tests/xfs/007
> index f2e3584..eb2c9b3 100755
> --- a/tests/xfs/007
> +++ b/tests/xfs/007
> @@ -68,8 +68,8 @@ do_test()
>  			grep $qino_2 | awk '{print $NF}'`
>  
>  	echo "*** Usage before quotarm ***"
> -	xfs_db -c "inode $QINO_1" -c "p core.nblocks" $SCRATCH_DEV
> -	xfs_db -c "inode $QINO_2" -c "p core.nblocks" $SCRATCH_DEV
> +	_scratch_xfs_db -c "inode $QINO_1" -c "p core.nblocks" 
> +	_scratch_xfs_db -c "inode $QINO_2" -c "p core.nblocks" 

I removed the trailing whitespace at commit time added by above lines
and some other lines in this patch.

Thanks,
Eryu

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

* Re: [PATCH 3/3] misc: fix more xfs_db open-coding instances
  2016-10-20 14:44   ` Eryu Guan
@ 2016-10-21  3:21     ` Darrick J. Wong
  0 siblings, 0 replies; 11+ messages in thread
From: Darrick J. Wong @ 2016-10-21  3:21 UTC (permalink / raw)
  To: Eryu Guan; +Cc: david, linux-xfs, hch, Christoph Hellwig, fstests

On Thu, Oct 20, 2016 at 10:44:59PM +0800, Eryu Guan wrote:
> On Mon, Oct 17, 2016 at 03:09:34PM -0700, Darrick J. Wong wrote:
> > Convert some more cases of 'xfs_db $SCRATCH_DEV' to _scratch_xfs_db
> > that were left out of the initial cleanup patch.
> > 
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > Reviewed-by: Christoph Hellwig <hch@lst.de>
> > ---
> >  tests/xfs/004 |    2 +-
> >  tests/xfs/007 |    8 ++++----
> >  tests/xfs/021 |    4 ++--
> >  tests/xfs/044 |    2 +-
> >  tests/xfs/052 |    2 +-
> >  tests/xfs/116 |    4 ++--
> >  tests/xfs/136 |    6 +++---
> >  tests/xfs/199 |    6 +++---
> >  tests/xfs/278 |   16 ++++++++--------
> >  tests/xfs/291 |    2 +-
> >  tests/xfs/307 |   20 ++++++++++----------
> >  tests/xfs/308 |   20 ++++++++++----------
> >  12 files changed, 46 insertions(+), 46 deletions(-)
> > 
> > 
> > diff --git a/tests/xfs/004 b/tests/xfs/004
> > index 59b8997..09da2fe 100755
> > --- a/tests/xfs/004
> > +++ b/tests/xfs/004
> > @@ -74,7 +74,7 @@ eval `$DF_PROG $SCRATCH_MNT 2>&1 \
> >  echo "df gave: blocks=$blocks used=$used avail=$avail" >>$seqres.full
> >  echo "blocksize from mkfs is '$dbsize'" >>$seqres.full
> >  
> > -xfs_db -r -c "freesp -s" $SCRATCH_DEV >$tmp.xfs_db
> > +_scratch_xfs_db -r -c "freesp -s"  >$tmp.xfs_db
> >  echo "xfs_db for $SCRATCH_DEV" >>$seqres.full
> >  cat $tmp.xfs_db >>$seqres.full
> >  
> > diff --git a/tests/xfs/007 b/tests/xfs/007
> > index f2e3584..eb2c9b3 100755
> > --- a/tests/xfs/007
> > +++ b/tests/xfs/007
> > @@ -68,8 +68,8 @@ do_test()
> >  			grep $qino_2 | awk '{print $NF}'`
> >  
> >  	echo "*** Usage before quotarm ***"
> > -	xfs_db -c "inode $QINO_1" -c "p core.nblocks" $SCRATCH_DEV
> > -	xfs_db -c "inode $QINO_2" -c "p core.nblocks" $SCRATCH_DEV
> > +	_scratch_xfs_db -c "inode $QINO_1" -c "p core.nblocks" 
> > +	_scratch_xfs_db -c "inode $QINO_2" -c "p core.nblocks" 
> 
> I removed the trailing whitespace at commit time added by above lines
> and some other lines in this patch.

Ok, thank you. :)

--D

> 
> Thanks,
> Eryu

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

* Re: [PATCH 2/3] misc: fix fallocate commands that need the unshare switch
  2016-10-16  6:18     ` Christoph Hellwig
@ 2016-10-17 21:57       ` Darrick J. Wong
  0 siblings, 0 replies; 11+ messages in thread
From: Darrick J. Wong @ 2016-10-17 21:57 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: david, eguan, linux-xfs, fstests, linux-btrfs

On Sat, Oct 15, 2016 at 11:18:37PM -0700, Christoph Hellwig wrote:
> On Sat, Oct 15, 2016 at 10:03:03AM -0700, Christoph Hellwig wrote:
> > The poster child would be btrfs, and I would have added some output
> > here if btrfs support in xfstests wasn't completely broken at this
> > point.
> > 
> > Well, added Ccs and some output anyway in this case..
> 
> Turns out the btrfs failure was my stupidity, sorry.
> 
> I can reproduce the issue I was going to originally show (which was
> actually pointed out by Eric for a different fallocate flag check
> I wanted to add), here is the diff of the output files when running
> generic/156 on btrfs with your patch:

Somehow it totally escaped my notice that I could just do:

_require_xfs_io_command "funshare"

and that would suffice for excluding things like btrfs.  Will
rework.

--D

> 
> --- tests/generic/156.out	2016-03-29 13:59:30.411720622 +0000
> +++ /root/xfstests/results//generic/156.out.bad	2016-10-16 06:15:27.118776421 +0000
> @@ -2,8 +2,13 @@
>  Create the original file blocks
>  Create the reflink copies
>  funshare part of a file
> +fallocate: Operation not supported
>  funshare some of the copies
> +fallocate: Operation not supported
> +fallocate: Operation not supported
>  funshare the rest of the files
> +fallocate: Operation not supported
> +fallocate: Operation not supported
>  Rewrite the original file
>  free blocks after reflinking is in range
>  free blocks after nocow'ing some copies is in range
> 
> So what we really need an enhanced falloc tester that checks that
> the tested subcommand is actually implemented on the given file system.
> (And we already need something like that for -k on NFS)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" 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] 11+ messages in thread

* Re: [PATCH 2/3] misc: fix fallocate commands that need the unshare switch
  2016-10-15 17:03   ` Christoph Hellwig
@ 2016-10-16  6:18     ` Christoph Hellwig
  2016-10-17 21:57       ` Darrick J. Wong
  0 siblings, 1 reply; 11+ messages in thread
From: Christoph Hellwig @ 2016-10-16  6:18 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: david, eguan, linux-xfs, fstests, linux-btrfs

On Sat, Oct 15, 2016 at 10:03:03AM -0700, Christoph Hellwig wrote:
> The poster child would be btrfs, and I would have added some output
> here if btrfs support in xfstests wasn't completely broken at this
> point.
> 
> Well, added Ccs and some output anyway in this case..

Turns out the btrfs failure was my stupidity, sorry.

I can reproduce the issue I was going to originally show (which was
actually pointed out by Eric for a different fallocate flag check
I wanted to add), here is the diff of the output files when running
generic/156 on btrfs with your patch:

--- tests/generic/156.out	2016-03-29 13:59:30.411720622 +0000
+++ /root/xfstests/results//generic/156.out.bad	2016-10-16 06:15:27.118776421 +0000
@@ -2,8 +2,13 @@
 Create the original file blocks
 Create the reflink copies
 funshare part of a file
+fallocate: Operation not supported
 funshare some of the copies
+fallocate: Operation not supported
+fallocate: Operation not supported
 funshare the rest of the files
+fallocate: Operation not supported
+fallocate: Operation not supported
 Rewrite the original file
 free blocks after reflinking is in range
 free blocks after nocow'ing some copies is in range

So what we really need an enhanced falloc tester that checks that
the tested subcommand is actually implemented on the given file system.
(And we already need something like that for -k on NFS)

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

* Re: [PATCH 2/3] misc: fix fallocate commands that need the unshare switch
  2016-10-14 18:13 ` [PATCH 2/3] misc: fix fallocate commands that need the unshare switch Darrick J. Wong
@ 2016-10-15 17:03   ` Christoph Hellwig
  2016-10-16  6:18     ` Christoph Hellwig
  0 siblings, 1 reply; 11+ messages in thread
From: Christoph Hellwig @ 2016-10-15 17:03 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: david, eguan, linux-xfs, fstests, linux-btrfs

On Fri, Oct 14, 2016 at 11:13:02AM -0700, Darrick J. Wong wrote:
> We re-added the UNSHARE flag to fallocate, so go make sure that all
> the unshare tests actually check that the xfs_io falloc command
> supports that flag.

We'll need to improve _require_xfs_io_command to actually run the
command for this to work, otherwise this will fail if the fs supports
reflink but not unshared once xfs_io supports -u.

The poster child would be btrfs, and I would have added some output
here if btrfs support in xfstests wasn't completely broken at this
point.

Well, added Ccs and some output anyway in this case..

root@testvm:~/xfstests# mkfs.btrfs -f /dev/vdb
Btrfs v3.17
See http://btrfs.wiki.kernel.org for more information.

Turning ON incompat feature 'extref': increased hardlink limit per file
to 65536
[  243.592803] BTRFS: device fsid 364c6d95-eaae-43c9-b6bd-139e86206519
devid 1 transid 3 /dev/vdb
fs created label (null) on /dev/vdb
	nodesize 16384 leafsize 16384 sectorsize 4096 size 10.00GiB
root@testvm:~/xfstests# ./check -g quick
[  246.101606] BTRFS info (device vdb): disk space caching is enabled
[  246.102260] BTRFS info (device vdb): flagging fs with big metadata
feature
[  246.106123] BTRFS info (device vdb): creating UUID tree
FSTYP         -- btrfs
PLATFORM      -- Linux/x86_64 testvm 4.8.0+
MKFS_OPTIONS  -- /dev/vdb
MOUNT_OPTIONS -- /dev/vdb /mnt/scratch

our local _scratch_mkfs routine ...
Error: /dev/vdb is mounted
check: failed to mkfs $SCRATCH_DEV using specified options
Passed all 0 tests

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

* [PATCH 2/3] misc: fix fallocate commands that need the unshare switch
  2016-10-14 18:12 [PATCH 0/3] xfstests: fix tests for rmap/reflink Darrick J. Wong
@ 2016-10-14 18:13 ` Darrick J. Wong
  2016-10-15 17:03   ` Christoph Hellwig
  0 siblings, 1 reply; 11+ messages in thread
From: Darrick J. Wong @ 2016-10-14 18:13 UTC (permalink / raw)
  To: david, eguan, darrick.wong; +Cc: linux-xfs, fstests

We re-added the UNSHARE flag to fallocate, so go make sure that all
the unshare tests actually check that the xfs_io falloc command
supports that flag.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/generic/156 |   16 ++++++----------
 tests/generic/264 |    4 ++--
 tests/xfs/132     |   12 ++++++------
 tests/xfs/184     |    3 ++-
 tests/xfs/192     |    3 ++-
 tests/xfs/200     |    3 ++-
 tests/xfs/204     |    3 ++-
 tests/xfs/344     |    1 +
 tests/xfs/345     |    1 +
 tests/xfs/346     |    1 +
 tests/xfs/347     |    1 +
 11 files changed, 26 insertions(+), 22 deletions(-)


diff --git a/tests/generic/156 b/tests/generic/156
index 9e22a02..b1b354b 100755
--- a/tests/generic/156
+++ b/tests/generic/156
@@ -54,15 +54,11 @@ _cleanup()
 . ./common/attr
 . ./common/reflink
 
-if [ $FSTYP = "btrfs" ]; then
-	_notrun "btrfs doesn't handle unshare on fallocate"
-fi
-
 # real QA test starts here
 _supported_os Linux
 _require_test_reflink
 _require_cp_reflink
-_require_xfs_io_command "falloc"
+_require_xfs_io_command "falloc" "-u"
 
 rm -f $seqres.full
 
@@ -89,18 +85,18 @@ _test_cycle_mount
 free_blocks1=$(stat -f $testdir -c '%f')
 
 echo "funshare part of a file"
-$XFS_IO_PROG -f -c "falloc 0 $((sz / 2))" $testdir/file2
+$XFS_IO_PROG -f -c "falloc -u 0 $((sz / 2))" $testdir/file2
 _test_cycle_mount
 
 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
+$XFS_IO_PROG -f -c "falloc -u 0 $sz" $testdir/file2
+$XFS_IO_PROG -f -c "falloc -u 0 $sz" $testdir/file3
 _test_cycle_mount
 free_blocks2=$(stat -f $testdir -c '%f')
 
 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
+$XFS_IO_PROG -f -c "falloc -u 0 $sz" $testdir/file4
+$XFS_IO_PROG -f -c "falloc -u 0 $sz" $testdir/file1
 _test_cycle_mount
 free_blocks3=$(stat -f $testdir -c '%f')
 
diff --git a/tests/generic/264 b/tests/generic/264
index 631184c..bc2f7e6 100755
--- a/tests/generic/264
+++ b/tests/generic/264
@@ -47,7 +47,7 @@ _cleanup()
 _supported_os Linux
 _require_scratch_reflink
 _require_cp_reflink
-_require_xfs_io_command "falloc"
+_require_xfs_io_command "falloc" "-u"
 
 rm -f $seqres.full
 
@@ -75,7 +75,7 @@ md5sum $testdir/file2 | _filter_scratch
 md5sum $testdir/file2.chk | _filter_scratch
 
 echo "CoW and unmount"
-$XFS_IO_PROG -f -c "pwrite -S 0x62 -b $((blksz * 3)) $blksz $((blksz * 3))" -c "falloc $((blksz * 2)) $blksz" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "pwrite -S 0x62 -b $((blksz * 3)) $blksz $((blksz * 3))" -c "falloc -u $((blksz * 2)) $blksz" $testdir/file2 >> $seqres.full
 _scratch_cycle_mount
 $XFS_IO_PROG -f -c "pwrite -S 0x62 -b $((blksz * 3)) $blksz $((blksz * 3))" $testdir/file2.chk >> $seqres.full
 _scratch_cycle_mount
diff --git a/tests/xfs/132 b/tests/xfs/132
index 7f7ebaa..6b8c05c 100755
--- a/tests/xfs/132
+++ b/tests/xfs/132
@@ -63,7 +63,7 @@ _supported_os Linux
 _require_test_reflink
 _require_test_lsattr
 _require_cp_reflink
-_require_xfs_io_command "falloc"
+_require_xfs_io_command "falloc" "-u"
 
 rm -f $seqres.full
 
@@ -90,18 +90,18 @@ _test_cycle_mount
 free_blocks1=$(stat -f $testdir -c '%f')
 
 echo "funshare part of a file"
-$XFS_IO_PROG -f -c "falloc 0 $((sz / 2))" $testdir/file2
+$XFS_IO_PROG -f -c "falloc -u 0 $((sz / 2))" $testdir/file2
 _test_cycle_mount
 
 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
+$XFS_IO_PROG -f -c "falloc -u 0 $sz" $testdir/file2
+$XFS_IO_PROG -f -c "falloc -u 0 $sz" $testdir/file3
 _test_cycle_mount
 free_blocks2=$(stat -f $testdir -c '%f')
 
 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
+$XFS_IO_PROG -f -c "falloc -u 0 $sz" $testdir/file4
+$XFS_IO_PROG -f -c "falloc -u 0 $sz" $testdir/file1
 _test_cycle_mount
 free_blocks3=$(stat -f $testdir -c '%f')
 
diff --git a/tests/xfs/184 b/tests/xfs/184
index e843b4e..af416e5 100755
--- a/tests/xfs/184
+++ b/tests/xfs/184
@@ -51,6 +51,7 @@ _require_scratch_reflink
 _require_cp_reflink
 _require_fiemap
 _require_xfs_io_command "cowextsize"
+_require_xfs_io_command "falloc" "-u"
 
 rm -f $seqres.full
 
@@ -84,7 +85,7 @@ md5sum $testdir/file2 | _filter_scratch
 echo "CoW and unmount"
 $XFS_IO_PROG -f -c "cowextsize" $testdir/file2 >> $seqres.full
 $XFS_IO_PROG -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((filesize + 1))" -c "fdatasync" $testdir/file2 >> $seqres.full
-$XFS_IO_PROG -f -c "falloc 0 $((filesize + 1))" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "falloc -u 0 $((filesize + 1))" $testdir/file2 >> $seqres.full
 _scratch_cycle_mount
 
 echo "Compare files"
diff --git a/tests/xfs/192 b/tests/xfs/192
index 01f5e1c..691b0a1 100755
--- a/tests/xfs/192
+++ b/tests/xfs/192
@@ -51,6 +51,7 @@ _require_scratch_reflink
 _require_cp_reflink
 _require_fiemap
 _require_xfs_io_command "cowextsize"
+_require_xfs_io_command "falloc" "-u"
 _require_odirect
 
 rm -f $seqres.full
@@ -85,7 +86,7 @@ md5sum $testdir/file2 | _filter_scratch
 echo "CoW and unmount"
 $XFS_IO_PROG -f -c "cowextsize" $testdir/file2 >> $seqres.full
 $XFS_IO_PROG -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $filesize" $testdir/file2 >> $seqres.full
-$XFS_IO_PROG -d -f -c "falloc 0 $filesize" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -d -f -c "falloc -u 0 $filesize" $testdir/file2 >> $seqres.full
 _scratch_cycle_mount
 
 echo "Compare files"
diff --git a/tests/xfs/200 b/tests/xfs/200
index ebb6e73..b9f2685 100755
--- a/tests/xfs/200
+++ b/tests/xfs/200
@@ -53,6 +53,7 @@ _require_scratch_reflink
 _require_cp_reflink
 _require_fiemap
 _require_xfs_io_command "cowextsize"
+_require_xfs_io_command "falloc" "-u"
 
 rm -f $seqres.full
 
@@ -88,7 +89,7 @@ $XFS_IO_PROG -f -c "cowextsize" $testdir/file2 >> $seqres.full
 cat $testdir/file2 > /dev/null
 $XFS_IO_PROG -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $filesize" -c "fdatasync" $testdir/file2 >> $seqres.full
 $XFS_IO_PROG -f -c "fadvise -d 0 $filesize" -c "fsync" $testdir/file2 >> $seqres.full
-$XFS_IO_PROG -f -c "falloc 0 $filesize" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "falloc -u 0 $filesize" $testdir/file2 >> $seqres.full
 _scratch_cycle_mount
 
 echo "Compare files"
diff --git a/tests/xfs/204 b/tests/xfs/204
index 6e5b896..4917fc0 100755
--- a/tests/xfs/204
+++ b/tests/xfs/204
@@ -53,6 +53,7 @@ _require_scratch_reflink
 _require_cp_reflink
 _require_fiemap
 _require_xfs_io_command "cowextsize"
+_require_xfs_io_command "falloc" "-u"
 _require_odirect
 
 rm -f $seqres.full
@@ -89,7 +90,7 @@ $XFS_IO_PROG -f -c "cowextsize" $testdir/file2 >> $seqres.full
 cat $testdir/file2 > /dev/null
 $XFS_IO_PROG -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $filesize" -c "fdatasync" $testdir/file2 >> $seqres.full
 $XFS_IO_PROG -f -c "fadvise -d 0 $filesize" -c "fsync" $testdir/file2 >> $seqres.full
-$XFS_IO_PROG -f -c "falloc 0 $filesize" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "falloc -u 0 $filesize" $testdir/file2 >> $seqres.full
 _scratch_cycle_mount
 
 echo "Compare files"
diff --git a/tests/xfs/344 b/tests/xfs/344
index 25bff1a..8b2f6a5 100755
--- a/tests/xfs/344
+++ b/tests/xfs/344
@@ -51,6 +51,7 @@ _require_scratch_reflink
 _require_cp_reflink
 _require_fiemap
 _require_xfs_io_command "cowextsize"
+_require_xfs_io_command "falloc" "-u"
 _require_odirect
 
 rm -f $seqres.full
diff --git a/tests/xfs/345 b/tests/xfs/345
index edb4443..1bb1db3 100755
--- a/tests/xfs/345
+++ b/tests/xfs/345
@@ -50,6 +50,7 @@ _require_scratch_reflink
 _require_cp_reflink
 _require_fiemap
 _require_xfs_io_command "cowextsize"
+_require_xfs_io_command "falloc" "-u"
 
 rm -f $seqres.full
 
diff --git a/tests/xfs/346 b/tests/xfs/346
index d0463eb..17c1050 100755
--- a/tests/xfs/346
+++ b/tests/xfs/346
@@ -51,6 +51,7 @@ _require_scratch_reflink
 _require_cp_reflink
 _require_fiemap
 _require_xfs_io_command "cowextsize"
+_require_xfs_io_command "falloc" "-u"
 _require_odirect
 
 rm -f $seqres.full
diff --git a/tests/xfs/347 b/tests/xfs/347
index 1578216..94898e7 100755
--- a/tests/xfs/347
+++ b/tests/xfs/347
@@ -51,6 +51,7 @@ _require_scratch_reflink
 _require_cp_reflink
 _require_fiemap
 _require_xfs_io_command "cowextsize"
+_require_xfs_io_command "falloc" "-u"
 
 rm -f $seqres.full
 


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

end of thread, other threads:[~2016-10-21  3:22 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-17 22:09 [PATCH v2 0/3] xfstests: fix tests for rmap/reflink Darrick J. Wong
2016-10-17 22:09 ` [PATCH 1/3] xfs: set the refcount btree cowflag when setting up cow Darrick J. Wong
2016-10-17 22:09 ` [PATCH 2/3] misc: fix fallocate commands that need the unshare switch Darrick J. Wong
2016-10-18  5:19   ` Christoph Hellwig
2016-10-17 22:09 ` [PATCH 3/3] misc: fix more xfs_db open-coding instances Darrick J. Wong
2016-10-20 14:44   ` Eryu Guan
2016-10-21  3:21     ` Darrick J. Wong
  -- strict thread matches above, loose matches on Subject: below --
2016-10-14 18:12 [PATCH 0/3] xfstests: fix tests for rmap/reflink Darrick J. Wong
2016-10-14 18:13 ` [PATCH 2/3] misc: fix fallocate commands that need the unshare switch Darrick J. Wong
2016-10-15 17:03   ` Christoph Hellwig
2016-10-16  6:18     ` Christoph Hellwig
2016-10-17 21:57       ` 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.