All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] xfstests: improve test 286 for repeated unwritten/hole extents.
@ 2012-07-03 15:41 Jeff Liu
  2012-07-09 15:18 ` Mark Tinguely
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jeff Liu @ 2012-07-03 15:41 UTC (permalink / raw)
  To: xfs

v2->v1.
* Drop the diff of seq.full.

Signed-off-by: Jie Liu <jeff.liu@oracle.com>

---
 286 |   87
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 86 insertions(+), 1 deletions(-)

diff --git a/286 b/286
index 03c343f..75b2151 100644
--- a/286
+++ b/286
@@ -105,10 +105,95 @@ test02()
 	cmp $src $dest || _fail "TEST02: file bytes check failed"
 }

-rm -f $seq.full
+# seek_copy_test_03 - tests file with unwritten with data, repeated
unwritten
+# without data, as well as data extents mapping.
+# verify results:
+# 1. file size is identical.
+# 2. perform cmp(1) to compare SRC and DEST file byte by byte.
+test03()
+{
+	rm -rf $src $dest
+
+	write_cmd="-c \"truncate 200m\""
+
+	#
+	# Firstly, make the file with allocated && reserved extents
+	# mapping without real data wrote.
+	#
+	for i in $(seq 0 10 180); do
+		offset=$(($((10 << 20)) + $i * $((1 << 20))))
+		write_cmd="$write_cmd -c \"falloc $offset 10m\""
+	done
+
+	#
+	# Secondly, write data to some unwritten extents, hence we
+	# have a test file will extents mapping as:
+	# |data|multiple unwritten_without_data|data| repeat...
+	for i in $(seq 0 60 180); do
+		offset=$(($((20 << 20)) + $i * $((1 << 20))))
+		write_cmd="$write_cmd -c \"pwrite $offset 10m\""
+	done
+
+	echo "*** test03() create sparse file ***" >>$seq.full
+	eval ${XFS_IO_PROG} -F -f "${write_cmd}" $src >>$seq.full 2>&1 ||
+		_fail "create sparse file failed!"
+	echo "*** test03() create sparse file done ***" >>$seq.full
+	echo >>$seq.full
+	$here/src/seek_copy_test $src $dest

+	test $(stat --printf "%s" $src) = $(stat --printf "%s" $dest) ||
+		_fail "TEST03: file size check failed"
+
+	cmp $src $dest || _fail "TEST03: file bytes check failed"
+}
+
+# seek_copy_test_04 - tests file with hole, repeated unwritten
+# without data, as well as data extents mapping.
+# verify results:
+# 1. file size is identical.
+# 2. perform cmp(1) to compare SRC and DEST file byte by byte.
+test04()
+{
+	rm -rf $src $dest
+
+	write_cmd="-c \"truncate 200m\""
+
+	#
+	# Firstly, make the file with allocated && reserved extents
+	# mapping without real data wrote.
+	#
+	for i in $(seq 30 30 180); do
+		offset=$(($((30 << 20)) + $i * $((1 << 20))))
+		write_cmd="$write_cmd -c \"falloc $offset 5m\""
+	done
+
+	#
+	# Secondly, write data to some unwritten extents, hence we
+	# have a test file will extents mapping as:
+	# |hole|multiple unwritten_without_data|hole|data| repeat...
+	for i in $(seq 30 90 180); do
+		offset=$(($((30 << 20)) + $i * $((1 << 20))))
+		write_cmd="$write_cmd -c \"pwrite $offset 2m\""
+	done
+
+	echo "*** test04() create sparse file ***" >>$seq.full
+	eval ${XFS_IO_PROG} -F -f "${write_cmd}" $src >>$seq.full 2>&1 ||
+		_fail "create sparse file failed!"
+	echo "*** test04() create sparse file done ***" >>$seq.full
+	echo >>$seq.full
+	$here/src/seek_copy_test $src $dest
+
+	test $(stat --printf "%s" $src) = $(stat --printf "%s" $dest) ||
+		_fail "TEST04: file size check failed"
+
+	cmp $src $dest || _fail "TEST04: file bytes check failed"
+}
+
+rm -f $seq.full
 test01
 test02
+test03
+test04

 status=0
 exit
-- 
1.7.9

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

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

* Re: [PATCH v2] xfstests: improve test 286 for repeated unwritten/hole extents.
  2012-07-03 15:41 [PATCH v2] xfstests: improve test 286 for repeated unwritten/hole extents Jeff Liu
@ 2012-07-09 15:18 ` Mark Tinguely
  2012-07-17  7:18 ` Christoph Hellwig
  2012-09-24 21:24 ` Mark Tinguely
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Tinguely @ 2012-07-09 15:18 UTC (permalink / raw)
  To: jeff.liu; +Cc: xfs

On 07/03/12 10:41, Jeff Liu wrote:
> v2->v1.
> * Drop the diff of seq.full.
>
> Signed-off-by: Jie Liu<jeff.liu@oracle.com>
>
> ---
>   286 |   87
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
>   1 files changed, 86 insertions(+), 1 deletions(-)

Looks good. I also perforned a xfs_bmap on the source and destination 
files to see the portions that were being detected and copied as data.


Reviewed-by: Mark Tinguely <tinguely@sgi.com>

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

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

* Re: [PATCH v2] xfstests: improve test 286 for repeated unwritten/hole extents.
  2012-07-03 15:41 [PATCH v2] xfstests: improve test 286 for repeated unwritten/hole extents Jeff Liu
  2012-07-09 15:18 ` Mark Tinguely
@ 2012-07-17  7:18 ` Christoph Hellwig
  2012-09-24 21:24 ` Mark Tinguely
  2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2012-07-17  7:18 UTC (permalink / raw)
  To: Jeff Liu; +Cc: 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] 4+ messages in thread

* Re: [PATCH v2] xfstests: improve test 286 for repeated unwritten/hole extents.
  2012-07-03 15:41 [PATCH v2] xfstests: improve test 286 for repeated unwritten/hole extents Jeff Liu
  2012-07-09 15:18 ` Mark Tinguely
  2012-07-17  7:18 ` Christoph Hellwig
@ 2012-09-24 21:24 ` Mark Tinguely
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Tinguely @ 2012-09-24 21:24 UTC (permalink / raw)
  To: jeff.liu; +Cc: xfs



Enlarge the test coverage of 286 to includes file mapping with repeated
hole/unwritten/unwritten_without_data/data intersections.

Those two new sub-tests could help verifying the current seek_data/seek_hole
improvements.

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>


Committed to git://oss.sgi.com/xfs/cmds/xfstests.git, master branch.

--Mark.

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

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

end of thread, other threads:[~2012-09-24 21:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-03 15:41 [PATCH v2] xfstests: improve test 286 for repeated unwritten/hole extents Jeff Liu
2012-07-09 15:18 ` Mark Tinguely
2012-07-17  7:18 ` Christoph Hellwig
2012-09-24 21:24 ` Mark Tinguely

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.