* [PATCH v5] xfstests: add a new test case for ext4 indirect-based file
@ 2013-05-13 16:40 Zheng Liu
2013-05-15 13:59 ` Rich Johnston
2013-05-15 15:31 ` Eric Sandeen
0 siblings, 2 replies; 6+ messages in thread
From: Zheng Liu @ 2013-05-13 16:40 UTC (permalink / raw)
To: xfs; +Cc: Rich Johnston, Eric Sandeen, Zheng Liu
From: Zheng Liu <wenqing.lz@taobao.com>
After applied this commit (864688d3), xfstests #255 will not test a
file system that cannot support fallocate(2), such as a indirect-based
file in ext4. So we need to add a new generic test case to test it.
The difference between #255 and this test case is only to use pwrite to
allocate blocks. Other filesystems should survive in this test case.
In the mean time, a new argument '-u' is added into _test_generic_punch
not to run unwritten tests.
Meanwhile this commit fixes a minor problem in #255 that testfile should
use $seq.$$ as testfile.
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Cc: Eric Sandeen <sandeen@sandeen.net>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Rich Johnston <rjohnston@sgi.com>
---
changelog:
* rebase against Eric's patch
* remove 'prealloc" from group
Hi Eric,
I take a close look at your patch, and 'xfs_io_opt' has been removed in your
patch. I am not sure whether I need to adjust my patch or not. Please let me
know if I need to change it. Currently I only remove '-F' argument from test
case.
Thanks,
- Zheng
common/punch | 164 ++++++++++++++++++++++++++-----------------------
tests/generic/255 | 2 +-
tests/generic/314 | 67 ++++++++++++++++++++
tests/generic/314.out | 165 ++++++++++++++++++++++++++++++++++++++++++++++++++
tests/generic/group | 1 +
5 files changed, 323 insertions(+), 76 deletions(-)
create mode 100755 tests/generic/314
create mode 100644 tests/generic/314.out
diff --git a/common/punch b/common/punch
index b9f9acd..f1fc92d 100644
--- a/common/punch
+++ b/common/punch
@@ -285,19 +285,25 @@ die_now()
# Use the -d flag to not sync the file between tests.
# This will test the handling of delayed extents
#
+# Use the -u flag to not run unwritten tests.
+# This will eliminate some unnecessary information.
+#
_test_generic_punch()
{
remove_testfile=1
sync_cmd="-c fsync"
+ unwritten_tests=1
OPTIND=1
- while getopts 'dk' OPTION
+ while getopts 'dku' OPTION
do
case $OPTION in
k) remove_testfile=
;;
d) sync_cmd=
;;
+ u) unwritten_tests=
+ ;;
?) echo Invalid flag
exit 1
;;
@@ -334,16 +340,18 @@ _test_generic_punch()
[ $? -ne 0 ] && die_now
_md5_checksum $testfile
- echo " 3. into unwritten space"
- if [ "$remove_testfile" ]; then
- rm -f $testfile
+ if [ "$unwritten_tests" ]; then
+ echo " 3. into unwritten space"
+ if [ "$remove_testfile" ]; then
+ rm -f $testfile
+ fi
+ $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+ -c "$alloc_cmd 0 20k" \
+ -c "$zero_cmd 4k 8k" \
+ -c "$map_cmd -v" $testfile | $filter_cmd
+ [ $? -ne 0 ] && die_now
+ _md5_checksum $testfile
fi
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
- -c "$alloc_cmd 0 20k" \
- -c "$zero_cmd 4k 8k" \
- -c "$map_cmd -v" $testfile | $filter_cmd
- [ $? -ne 0 ] && die_now
- _md5_checksum $testfile
echo " 4. hole -> data"
if [ "$remove_testfile" ]; then
@@ -356,16 +364,18 @@ _test_generic_punch()
[ $? -ne 0 ] && die_now
_md5_checksum $testfile
- echo " 5. hole -> unwritten"
- if [ "$remove_testfile" ]; then
- rm -f $testfile
+ if [ "$unwritten_tests" ]; then
+ echo " 5. hole -> unwritten"
+ if [ "$remove_testfile" ]; then
+ rm -f $testfile
+ fi
+ $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+ -c "$alloc_cmd 8k 8k" \
+ -c "$zero_cmd 4k 8k" \
+ -c "$map_cmd -v" $testfile | $filter_cmd
+ [ $? -ne 0 ] && die_now
+ _md5_checksum $testfile
fi
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
- -c "$alloc_cmd 8k 8k" \
- -c "$zero_cmd 4k 8k" \
- -c "$map_cmd -v" $testfile | $filter_cmd
- [ $? -ne 0 ] && die_now
- _md5_checksum $testfile
echo " 6. data -> hole"
if [ "$remove_testfile" ]; then
@@ -378,40 +388,42 @@ _test_generic_punch()
[ $? -ne 0 ] && die_now
_md5_checksum $testfile
- echo " 7. data -> unwritten"
- if [ "$remove_testfile" ]; then
- rm -f $testfile
- fi
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
- -c "pwrite 0 8k" $sync_cmd \
- -c "$alloc_cmd 8k 8k" \
- -c "$zero_cmd 4k 8k" \
- -c "$map_cmd -v" $testfile | $filter_cmd
- [ $? -ne 0 ] && die_now
- _md5_checksum $testfile
-
- echo " 8. unwritten -> hole"
- if [ "$remove_testfile" ]; then
- rm -f $testfile
- fi
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
- -c "$alloc_cmd 0 8k" \
- -c "$zero_cmd 4k 8k" \
- -c "$map_cmd -v" $testfile | $filter_cmd
- [ $? -ne 0 ] && die_now
- _md5_checksum $testfile
-
- echo " 9. unwritten -> data"
- if [ "$remove_testfile" ]; then
- rm -f $testfile
+ if [ "$unwritten_tests" ]; then
+ echo " 7. data -> unwritten"
+ if [ "$remove_testfile" ]; then
+ rm -f $testfile
+ fi
+ $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+ -c "pwrite 0 8k" $sync_cmd \
+ -c "$alloc_cmd 8k 8k" \
+ -c "$zero_cmd 4k 8k" \
+ -c "$map_cmd -v" $testfile | $filter_cmd
+ [ $? -ne 0 ] && die_now
+ _md5_checksum $testfile
+
+ echo " 8. unwritten -> hole"
+ if [ "$remove_testfile" ]; then
+ rm -f $testfile
+ fi
+ $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+ -c "$alloc_cmd 0 8k" \
+ -c "$zero_cmd 4k 8k" \
+ -c "$map_cmd -v" $testfile | $filter_cmd
+ [ $? -ne 0 ] && die_now
+ _md5_checksum $testfile
+
+ echo " 9. unwritten -> data"
+ if [ "$remove_testfile" ]; then
+ rm -f $testfile
+ fi
+ $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+ -c "$alloc_cmd 0 8k" \
+ -c "pwrite 8k 8k" $sync_cmd \
+ -c "$zero_cmd 4k 8k" \
+ -c "$map_cmd -v" $testfile | $filter_cmd
+ [ $? -ne 0 ] && die_now
+ _md5_checksum $testfile
fi
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
- -c "$alloc_cmd 0 8k" \
- -c "pwrite 8k 8k" $sync_cmd \
- -c "$zero_cmd 4k 8k" \
- -c "$map_cmd -v" $testfile | $filter_cmd
- [ $? -ne 0 ] && die_now
- _md5_checksum $testfile
echo " 10. hole -> data -> hole"
if [ "$remove_testfile" ]; then
@@ -438,30 +450,32 @@ _test_generic_punch()
[ $? -ne 0 ] && die_now
_md5_checksum $testfile
- echo " 12. unwritten -> data -> unwritten"
- if [ "$remove_testfile" ]; then
- rm -f $testfile
- fi
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
- -c "$alloc_cmd 0 20k" \
- -c "pwrite 8k 4k" $sync_cmd \
- -c "$zero_cmd 4k 12k" \
- -c "$map_cmd -v" $testfile | $filter_cmd
- [ $? -ne 0 ] && die_now
- _md5_checksum $testfile
-
- echo " 13. data -> unwritten -> data"
- if [ "$remove_testfile" ]; then
- rm -f $testfile
+ if [ "$unwritten_tests" ]; then
+ echo " 12. unwritten -> data -> unwritten"
+ if [ "$remove_testfile" ]; then
+ rm -f $testfile
+ fi
+ $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+ -c "$alloc_cmd 0 20k" \
+ -c "pwrite 8k 4k" $sync_cmd \
+ -c "$zero_cmd 4k 12k" \
+ -c "$map_cmd -v" $testfile | $filter_cmd
+ [ $? -ne 0 ] && die_now
+ _md5_checksum $testfile
+
+ echo " 13. data -> unwritten -> data"
+ if [ "$remove_testfile" ]; then
+ rm -f $testfile
+ fi
+ $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+ -c "$alloc_cmd 0 20k" \
+ -c "pwrite 0k 8k" $sync_cmd \
+ -c "pwrite 12k 8k" -c "fsync" \
+ -c "$zero_cmd 4k 12k" \
+ -c "$map_cmd -v" $testfile | $filter_cmd
+ [ $? -ne 0 ] && die_now
+ _md5_checksum $testfile
fi
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
- -c "$alloc_cmd 0 20k" \
- -c "pwrite 0k 8k" $sync_cmd \
- -c "pwrite 12k 8k" -c "fsync" \
- -c "$zero_cmd 4k 12k" \
- -c "$map_cmd -v" $testfile | $filter_cmd
- [ $? -ne 0 ] && die_now
- _md5_checksum $testfile
echo " 14. data -> hole @ EOF"
rm -f $testfile
diff --git a/tests/generic/255 b/tests/generic/255
index 2e8ddef..d1f463c 100755
--- a/tests/generic/255
+++ b/tests/generic/255
@@ -50,7 +50,7 @@ _require_xfs_io_falloc_punch
_require_xfs_io_falloc
_require_xfs_io_fiemap
-testfile=$TEST_DIR/255.$$
+testfile=$TEST_DIR/$seq.$$
# Standard punch hole tests
_test_generic_punch falloc fpunch fpunch fiemap _filter_hole_fiemap $testfile -F
diff --git a/tests/generic/314 b/tests/generic/314
new file mode 100755
index 0000000..4cd7462
--- /dev/null
+++ b/tests/generic/314
@@ -0,0 +1,67 @@
+#! /bin/bash
+# FS QA Test No. 314
+#
+# Test Generic fallocate hole punching w/o unwritten extent
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 Alibaba Group. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ cd /
+ rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/punch
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+
+_require_xfs_io_falloc_punch
+_require_xfs_io_fiemap
+
+testfile=$TEST_DIR/$seq.$$
+
+# Standard punch hole tests
+_test_generic_punch -u pwrite fpunch fpunch fiemap _filter_hole_fiemap $testfile
+
+# Delayed allocation punch hole tests
+_test_generic_punch -u -d pwrite fpunch fpunch fiemap _filter_hole_fiemap $testfile
+
+# Multi hole punch tests
+_test_generic_punch -u -k pwrite fpunch fpunch fiemap _filter_hole_fiemap $testfile
+
+# Delayed allocation multi punch hole tests
+_test_generic_punch -u -d -k pwrite fpunch fpunch fiemap _filter_hole_fiemap $testfile
+
+# success, all done
+status=0
+exit
diff --git a/tests/generic/314.out b/tests/generic/314.out
new file mode 100644
index 0000000..06aa705
--- /dev/null
+++ b/tests/generic/314.out
@@ -0,0 +1,165 @@
+QA output created by 314
+ 1. into a hole
+daa100df6e6711906b61c9ab5aa16032
+ 2. into allocated space
+0: [0..7]: extent
+1: [8..23]: hole
+2: [24..39]: extent
+cc58a7417c2d7763adc45b6fcd3fa024
+ 4. hole -> data
+0: [0..23]: hole
+1: [24..31]: extent
+2: [32..39]: hole
+cc63069677939f69a6e8f68cae6a6dac
+ 6. data -> hole
+0: [0..7]: extent
+1: [8..39]: hole
+1b3779878366498b28c702ef88c4a773
+ 10. hole -> data -> hole
+daa100df6e6711906b61c9ab5aa16032
+ 11. data -> hole -> data
+0: [0..7]: extent
+1: [8..31]: hole
+2: [32..39]: extent
+f6aeca13ec49e5b266cd1c913cd726e3
+ 14. data -> hole @ EOF
+0: [0..23]: extent
+1: [24..39]: hole
+e1f024eedd27ea6b1c3e9b841c850404
+ 15. data -> hole @ 0
+0: [0..15]: hole
+1: [16..39]: extent
+eecb7aa303d121835de05028751d301c
+ 16. data -> cache cold ->hole
+0: [0..15]: hole
+1: [16..39]: extent
+eecb7aa303d121835de05028751d301c
+ 17. data -> hole in single block file
+0: [0..7]: extent
+13535fd4d496bf0b74bb2335aa4d1b31
+ 1. into a hole
+daa100df6e6711906b61c9ab5aa16032
+ 2. into allocated space
+0: [0..7]: extent
+1: [8..23]: hole
+2: [24..39]: extent
+cc58a7417c2d7763adc45b6fcd3fa024
+ 4. hole -> data
+0: [0..23]: hole
+1: [24..31]: extent
+2: [32..39]: hole
+cc63069677939f69a6e8f68cae6a6dac
+ 6. data -> hole
+0: [0..7]: extent
+1: [8..39]: hole
+1b3779878366498b28c702ef88c4a773
+ 10. hole -> data -> hole
+daa100df6e6711906b61c9ab5aa16032
+ 11. data -> hole -> data
+0: [0..7]: extent
+1: [8..31]: hole
+2: [32..39]: extent
+f6aeca13ec49e5b266cd1c913cd726e3
+ 14. data -> hole @ EOF
+0: [0..23]: extent
+1: [24..39]: hole
+e1f024eedd27ea6b1c3e9b841c850404
+ 15. data -> hole @ 0
+0: [0..15]: hole
+1: [16..39]: extent
+eecb7aa303d121835de05028751d301c
+ 16. data -> cache cold ->hole
+0: [0..15]: hole
+1: [16..39]: extent
+eecb7aa303d121835de05028751d301c
+ 17. data -> hole in single block file
+0: [0..7]: extent
+13535fd4d496bf0b74bb2335aa4d1b31
+ 1. into a hole
+0: [0..7]: extent
+1: [8..39]: hole
+5a58e46082be047d0f13bee7974015b9
+ 2. into allocated space
+0: [0..7]: extent
+1: [8..23]: hole
+2: [24..39]: extent
+cc58a7417c2d7763adc45b6fcd3fa024
+ 4. hole -> data
+0: [0..7]: extent
+1: [8..23]: hole
+2: [24..39]: extent
+cc58a7417c2d7763adc45b6fcd3fa024
+ 6. data -> hole
+0: [0..7]: extent
+1: [8..23]: hole
+2: [24..39]: extent
+cc58a7417c2d7763adc45b6fcd3fa024
+ 10. hole -> data -> hole
+0: [0..7]: extent
+1: [8..31]: hole
+2: [32..39]: extent
+f6aeca13ec49e5b266cd1c913cd726e3
+ 11. data -> hole -> data
+0: [0..7]: extent
+1: [8..31]: hole
+2: [32..39]: extent
+f6aeca13ec49e5b266cd1c913cd726e3
+ 14. data -> hole @ EOF
+0: [0..23]: extent
+1: [24..39]: hole
+e1f024eedd27ea6b1c3e9b841c850404
+ 15. data -> hole @ 0
+0: [0..15]: hole
+1: [16..39]: extent
+eecb7aa303d121835de05028751d301c
+ 16. data -> cache cold ->hole
+0: [0..15]: hole
+1: [16..39]: extent
+eecb7aa303d121835de05028751d301c
+ 17. data -> hole in single block file
+0: [0..7]: extent
+13535fd4d496bf0b74bb2335aa4d1b31
+ 1. into a hole
+0: [0..7]: extent
+1: [8..39]: hole
+5a58e46082be047d0f13bee7974015b9
+ 2. into allocated space
+0: [0..7]: extent
+1: [8..23]: hole
+2: [24..39]: extent
+cc58a7417c2d7763adc45b6fcd3fa024
+ 4. hole -> data
+0: [0..7]: extent
+1: [8..23]: hole
+2: [24..39]: extent
+cc58a7417c2d7763adc45b6fcd3fa024
+ 6. data -> hole
+0: [0..7]: extent
+1: [8..23]: hole
+2: [24..39]: extent
+cc58a7417c2d7763adc45b6fcd3fa024
+ 10. hole -> data -> hole
+0: [0..7]: extent
+1: [8..31]: hole
+2: [32..39]: extent
+f6aeca13ec49e5b266cd1c913cd726e3
+ 11. data -> hole -> data
+0: [0..7]: extent
+1: [8..31]: hole
+2: [32..39]: extent
+f6aeca13ec49e5b266cd1c913cd726e3
+ 14. data -> hole @ EOF
+0: [0..23]: extent
+1: [24..39]: hole
+e1f024eedd27ea6b1c3e9b841c850404
+ 15. data -> hole @ 0
+0: [0..15]: hole
+1: [16..39]: extent
+eecb7aa303d121835de05028751d301c
+ 16. data -> cache cold ->hole
+0: [0..15]: hole
+1: [16..39]: extent
+eecb7aa303d121835de05028751d301c
+ 17. data -> hole in single block file
+0: [0..7]: extent
+13535fd4d496bf0b74bb2335aa4d1b31
diff --git a/tests/generic/group b/tests/generic/group
index 5a03a09..4d84d1e 100644
--- a/tests/generic/group
+++ b/tests/generic/group
@@ -114,3 +114,4 @@
309 auto quick
310 auto
311 auto metadata log
+314 auto quick
--
1.7.12.rc2.18.g61b472e
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH v5] xfstests: add a new test case for ext4 indirect-based file
2013-05-13 16:40 [PATCH v5] xfstests: add a new test case for ext4 indirect-based file Zheng Liu
@ 2013-05-15 13:59 ` Rich Johnston
2013-05-15 15:31 ` Zheng Liu
2013-05-15 15:31 ` Eric Sandeen
1 sibling, 1 reply; 6+ messages in thread
From: Rich Johnston @ 2013-05-15 13:59 UTC (permalink / raw)
To: Zheng Liu; +Cc: Zheng Liu, Eric Sandeen, xfs
On 05/13/2013 11:40 AM, Zheng Liu wrote:
> From: Zheng Liu <wenqing.lz@taobao.com>
>
> After applied this commit (864688d3), xfstests #255 will not test a
> file system that cannot support fallocate(2), such as a indirect-based
> file in ext4. So we need to add a new generic test case to test it.
>
> The difference between #255 and this test case is only to use pwrite to
> allocate blocks. Other filesystems should survive in this test case.
> In the mean time, a new argument '-u' is added into _test_generic_punch
> not to run unwritten tests.
>
> Meanwhile this commit fixes a minor problem in #255 that testfile should
> use $seq.$$ as testfile.
>
> Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
> Cc: Eric Sandeen <sandeen@sandeen.net>
> Cc: Dave Chinner <david@fromorbit.com>
> Cc: Rich Johnston <rjohnston@sgi.com>
> ---
> changelog:
> * rebase against Eric's patch
> * remove 'prealloc" from group
>
> Hi Eric,
>
> I take a close look at your patch, and 'xfs_io_opt' has been removed in your
> patch. I am not sure whether I need to adjust my patch or not. Please let me
> know if I need to change it. Currently I only remove '-F' argument from test
> case.
>
> Thanks,
> - Zheng
>
> common/punch | 164 ++++++++++++++++++++++++++-----------------------
> tests/generic/255 | 2 +-
> tests/generic/314 | 67 ++++++++++++++++++++
> tests/generic/314.out | 165 ++++++++++++++++++++++++++++++++++++++++++++++++++
> tests/generic/group | 1 +
> 5 files changed, 323 insertions(+), 76 deletions(-)
> create mode 100755 tests/generic/314
> create mode 100644 tests/generic/314.out
>
> diff --git a/common/punch b/common/punch
> index b9f9acd..f1fc92d 100644
> --- a/common/punch
> +++ b/common/punch
> @@ -285,19 +285,25 @@ die_now()
> # Use the -d flag to not sync the file between tests.
> # This will test the handling of delayed extents
> #
> +# Use the -u flag to not run unwritten tests.
> +# This will eliminate some unnecessary information.
> +#
> _test_generic_punch()
> {
>
> remove_testfile=1
> sync_cmd="-c fsync"
> + unwritten_tests=1
> OPTIND=1
> - while getopts 'dk' OPTION
> + while getopts 'dku' OPTION
> do
> case $OPTION in
> k) remove_testfile=
> ;;
> d) sync_cmd=
> ;;
> + u) unwritten_tests=
> + ;;
> ?) echo Invalid flag
> exit 1
> ;;
> @@ -334,16 +340,18 @@ _test_generic_punch()
> [ $? -ne 0 ] && die_now
> _md5_checksum $testfile
>
> - echo " 3. into unwritten space"
> - if [ "$remove_testfile" ]; then
> - rm -f $testfile
> + if [ "$unwritten_tests" ]; then
> + echo " 3. into unwritten space"
> + if [ "$remove_testfile" ]; then
> + rm -f $testfile
> + fi
> + $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
> + -c "$alloc_cmd 0 20k" \
> + -c "$zero_cmd 4k 8k" \
> + -c "$map_cmd -v" $testfile | $filter_cmd
> + [ $? -ne 0 ] && die_now
> + _md5_checksum $testfile
> fi
> - $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
> - -c "$alloc_cmd 0 20k" \
> - -c "$zero_cmd 4k 8k" \
> - -c "$map_cmd -v" $testfile | $filter_cmd
> - [ $? -ne 0 ] && die_now
> - _md5_checksum $testfile
>
> echo " 4. hole -> data"
> if [ "$remove_testfile" ]; then
> @@ -356,16 +364,18 @@ _test_generic_punch()
> [ $? -ne 0 ] && die_now
> _md5_checksum $testfile
>
> - echo " 5. hole -> unwritten"
> - if [ "$remove_testfile" ]; then
> - rm -f $testfile
> + if [ "$unwritten_tests" ]; then
> + echo " 5. hole -> unwritten"
> + if [ "$remove_testfile" ]; then
> + rm -f $testfile
> + fi
> + $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
> + -c "$alloc_cmd 8k 8k" \
> + -c "$zero_cmd 4k 8k" \
> + -c "$map_cmd -v" $testfile | $filter_cmd
> + [ $? -ne 0 ] && die_now
> + _md5_checksum $testfile
> fi
> - $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
> - -c "$alloc_cmd 8k 8k" \
> - -c "$zero_cmd 4k 8k" \
> - -c "$map_cmd -v" $testfile | $filter_cmd
> - [ $? -ne 0 ] && die_now
> - _md5_checksum $testfile
>
> echo " 6. data -> hole"
> if [ "$remove_testfile" ]; then
> @@ -378,40 +388,42 @@ _test_generic_punch()
> [ $? -ne 0 ] && die_now
> _md5_checksum $testfile
>
> - echo " 7. data -> unwritten"
> - if [ "$remove_testfile" ]; then
> - rm -f $testfile
> - fi
> - $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
> - -c "pwrite 0 8k" $sync_cmd \
> - -c "$alloc_cmd 8k 8k" \
> - -c "$zero_cmd 4k 8k" \
> - -c "$map_cmd -v" $testfile | $filter_cmd
> - [ $? -ne 0 ] && die_now
> - _md5_checksum $testfile
> -
> - echo " 8. unwritten -> hole"
> - if [ "$remove_testfile" ]; then
> - rm -f $testfile
> - fi
> - $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
> - -c "$alloc_cmd 0 8k" \
> - -c "$zero_cmd 4k 8k" \
> - -c "$map_cmd -v" $testfile | $filter_cmd
> - [ $? -ne 0 ] && die_now
> - _md5_checksum $testfile
> -
> - echo " 9. unwritten -> data"
> - if [ "$remove_testfile" ]; then
> - rm -f $testfile
> + if [ "$unwritten_tests" ]; then
> + echo " 7. data -> unwritten"
> + if [ "$remove_testfile" ]; then
> + rm -f $testfile
> + fi
> + $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
> + -c "pwrite 0 8k" $sync_cmd \
> + -c "$alloc_cmd 8k 8k" \
> + -c "$zero_cmd 4k 8k" \
> + -c "$map_cmd -v" $testfile | $filter_cmd
> + [ $? -ne 0 ] && die_now
> + _md5_checksum $testfile
> +
> + echo " 8. unwritten -> hole"
> + if [ "$remove_testfile" ]; then
> + rm -f $testfile
> + fi
> + $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
> + -c "$alloc_cmd 0 8k" \
> + -c "$zero_cmd 4k 8k" \
> + -c "$map_cmd -v" $testfile | $filter_cmd
> + [ $? -ne 0 ] && die_now
> + _md5_checksum $testfile
> +
> + echo " 9. unwritten -> data"
> + if [ "$remove_testfile" ]; then
> + rm -f $testfile
> + fi
> + $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
> + -c "$alloc_cmd 0 8k" \
> + -c "pwrite 8k 8k" $sync_cmd \
> + -c "$zero_cmd 4k 8k" \
> + -c "$map_cmd -v" $testfile | $filter_cmd
> + [ $? -ne 0 ] && die_now
> + _md5_checksum $testfile
> fi
> - $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
> - -c "$alloc_cmd 0 8k" \
> - -c "pwrite 8k 8k" $sync_cmd \
> - -c "$zero_cmd 4k 8k" \
> - -c "$map_cmd -v" $testfile | $filter_cmd
> - [ $? -ne 0 ] && die_now
> - _md5_checksum $testfile
>
> echo " 10. hole -> data -> hole"
> if [ "$remove_testfile" ]; then
> @@ -438,30 +450,32 @@ _test_generic_punch()
> [ $? -ne 0 ] && die_now
> _md5_checksum $testfile
>
> - echo " 12. unwritten -> data -> unwritten"
> - if [ "$remove_testfile" ]; then
> - rm -f $testfile
> - fi
> - $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
> - -c "$alloc_cmd 0 20k" \
> - -c "pwrite 8k 4k" $sync_cmd \
> - -c "$zero_cmd 4k 12k" \
> - -c "$map_cmd -v" $testfile | $filter_cmd
> - [ $? -ne 0 ] && die_now
> - _md5_checksum $testfile
> -
> - echo " 13. data -> unwritten -> data"
> - if [ "$remove_testfile" ]; then
> - rm -f $testfile
> + if [ "$unwritten_tests" ]; then
> + echo " 12. unwritten -> data -> unwritten"
> + if [ "$remove_testfile" ]; then
> + rm -f $testfile
> + fi
> + $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
> + -c "$alloc_cmd 0 20k" \
> + -c "pwrite 8k 4k" $sync_cmd \
> + -c "$zero_cmd 4k 12k" \
> + -c "$map_cmd -v" $testfile | $filter_cmd
> + [ $? -ne 0 ] && die_now
> + _md5_checksum $testfile
> +
> + echo " 13. data -> unwritten -> data"
> + if [ "$remove_testfile" ]; then
> + rm -f $testfile
> + fi
> + $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
> + -c "$alloc_cmd 0 20k" \
> + -c "pwrite 0k 8k" $sync_cmd \
> + -c "pwrite 12k 8k" -c "fsync" \
> + -c "$zero_cmd 4k 12k" \
> + -c "$map_cmd -v" $testfile | $filter_cmd
> + [ $? -ne 0 ] && die_now
> + _md5_checksum $testfile
> fi
> - $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
> - -c "$alloc_cmd 0 20k" \
> - -c "pwrite 0k 8k" $sync_cmd \
> - -c "pwrite 12k 8k" -c "fsync" \
> - -c "$zero_cmd 4k 12k" \
> - -c "$map_cmd -v" $testfile | $filter_cmd
> - [ $? -ne 0 ] && die_now
> - _md5_checksum $testfile
>
> echo " 14. data -> hole @ EOF"
> rm -f $testfile
Hey Zheng,
Thanks for submitting this patch. Looks like this patch does not apply
cleanly.
--Rich
Applying
patch..v5-xfstests-add-a-new-test-case-for-ext4-indirect-based-file.patch
error: patch failed: common/punch:334
error: common/punch: patch does not apply
Context reduced to (2/2) to apply fragment at 51
To force apply this patch, use 'guilt push -f'
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH v5] xfstests: add a new test case for ext4 indirect-based file
2013-05-15 13:59 ` Rich Johnston
@ 2013-05-15 15:31 ` Zheng Liu
2013-05-15 15:22 ` Eric Sandeen
0 siblings, 1 reply; 6+ messages in thread
From: Zheng Liu @ 2013-05-15 15:31 UTC (permalink / raw)
To: Rich Johnston; +Cc: Zheng Liu, Eric Sandeen, xfs
On Wed, May 15, 2013 at 08:59:52AM -0500, Rich Johnston wrote:
[...]
> Hey Zheng,
>
> Thanks for submitting this patch. Looks like this patch does not
> apply cleanly.
Hi Rich,
Yes, this patch bases against Eric's patch:
[PATCH] xfstests: automatically add -F to xfs_io on non-xfs
But his patch hasn't been applied. So that is why this patch doesn't
apply cleanly. Do I need to resend a cleanly version?
Thanks,
- Zheng
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH v5] xfstests: add a new test case for ext4 indirect-based file
2013-05-15 15:31 ` Zheng Liu
@ 2013-05-15 15:22 ` Eric Sandeen
0 siblings, 0 replies; 6+ messages in thread
From: Eric Sandeen @ 2013-05-15 15:22 UTC (permalink / raw)
To: Zheng Liu; +Cc: Zheng Liu, Rich Johnston, xfs
On 5/15/13 10:31 AM, Zheng Liu wrote:
> On Wed, May 15, 2013 at 08:59:52AM -0500, Rich Johnston wrote:
> [...]
>> Hey Zheng,
>>
>> Thanks for submitting this patch. Looks like this patch does not
>> apply cleanly.
>
> Hi Rich,
>
> Yes, this patch bases against Eric's patch:
> [PATCH] xfstests: automatically add -F to xfs_io on non-xfs
>
> But his patch hasn't been applied. So that is why this patch doesn't
> apply cleanly. Do I need to resend a cleanly version?
My patch is now applied...
The joys of distributed development ;)
-Eric
> Thanks,
> - Zheng
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v5] xfstests: add a new test case for ext4 indirect-based file
2013-05-13 16:40 [PATCH v5] xfstests: add a new test case for ext4 indirect-based file Zheng Liu
2013-05-15 13:59 ` Rich Johnston
@ 2013-05-15 15:31 ` Eric Sandeen
2013-05-16 3:57 ` Zheng Liu
1 sibling, 1 reply; 6+ messages in thread
From: Eric Sandeen @ 2013-05-15 15:31 UTC (permalink / raw)
To: Zheng Liu; +Cc: Rich Johnston, Zheng Liu, xfs
On 5/13/13 11:40 AM, Zheng Liu wrote:
> From: Zheng Liu <wenqing.lz@taobao.com>
>
> After applied this commit (864688d3), xfstests #255 will not test a
> file system that cannot support fallocate(2), such as a indirect-based
> file in ext4. So we need to add a new generic test case to test it.
>
> The difference between #255 and this test case is only to use pwrite to
> allocate blocks. Other filesystems should survive in this test case.
> In the mean time, a new argument '-u' is added into _test_generic_punch
> not to run unwritten tests.
>
> Meanwhile this commit fixes a minor problem in #255 that testfile should
> use $seq.$$ as testfile.
>
> Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
> Cc: Eric Sandeen <sandeen@sandeen.net>
> Cc: Dave Chinner <david@fromorbit.com>
> Cc: Rich Johnston <rjohnston@sgi.com>
> ---
> changelog:
> * rebase against Eric's patch
> * remove 'prealloc" from group
>
> Hi Eric,
>
> I take a close look at your patch, and 'xfs_io_opt' has been removed in your
> patch. I am not sure whether I need to adjust my patch or not. Please let me
> know if I need to change it. Currently I only remove '-F' argument from test
> case.
xfs_io_opt was an option passed to _test_generic_punch used for "-F", as in:
_test_generic_punch -k falloc fpunch fpunch fiemap _filter_hole_fiemap $testfile -F
-F is no longer needed, so I just dropped the whole thing.
I'm sorry this patch has required so much work. :(
If you simply replace "$xfs_io_opt " with "" in this patch, it applies
again with some fuzz. i.e. in vim I just did:
:%s/$xfs_io_opt //g
to fix up the patch itself.
There is also still one instance of "-F" in the context of the hunk
in tests/generic/255 as well which causes a little fuzz.]
Thank you for your perseverance on this patch. :)
-Eric
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v5] xfstests: add a new test case for ext4 indirect-based file
2013-05-15 15:31 ` Eric Sandeen
@ 2013-05-16 3:57 ` Zheng Liu
0 siblings, 0 replies; 6+ messages in thread
From: Zheng Liu @ 2013-05-16 3:57 UTC (permalink / raw)
To: Eric Sandeen; +Cc: Rich Johnston, Zheng Liu, xfs
On Wed, May 15, 2013 at 10:31:53AM -0500, Eric Sandeen wrote:
> On 5/13/13 11:40 AM, Zheng Liu wrote:
> > From: Zheng Liu <wenqing.lz@taobao.com>
> >
> > After applied this commit (864688d3), xfstests #255 will not test a
> > file system that cannot support fallocate(2), such as a indirect-based
> > file in ext4. So we need to add a new generic test case to test it.
> >
> > The difference between #255 and this test case is only to use pwrite to
> > allocate blocks. Other filesystems should survive in this test case.
> > In the mean time, a new argument '-u' is added into _test_generic_punch
> > not to run unwritten tests.
> >
> > Meanwhile this commit fixes a minor problem in #255 that testfile should
> > use $seq.$$ as testfile.
> >
> > Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
> > Cc: Eric Sandeen <sandeen@sandeen.net>
> > Cc: Dave Chinner <david@fromorbit.com>
> > Cc: Rich Johnston <rjohnston@sgi.com>
> > ---
> > changelog:
> > * rebase against Eric's patch
> > * remove 'prealloc" from group
> >
> > Hi Eric,
> >
> > I take a close look at your patch, and 'xfs_io_opt' has been removed in your
> > patch. I am not sure whether I need to adjust my patch or not. Please let me
> > know if I need to change it. Currently I only remove '-F' argument from test
> > case.
>
> xfs_io_opt was an option passed to _test_generic_punch used for "-F", as in:
>
> _test_generic_punch -k falloc fpunch fpunch fiemap _filter_hole_fiemap $testfile -F
>
> -F is no longer needed, so I just dropped the whole thing.
>
> I'm sorry this patch has required so much work. :(
>
> If you simply replace "$xfs_io_opt " with "" in this patch, it applies
> again with some fuzz. i.e. in vim I just did:
>
> :%s/$xfs_io_opt //g
>
> to fix up the patch itself.
>
> There is also still one instance of "-F" in the context of the hunk
> in tests/generic/255 as well which causes a little fuzz.]
Hi Eric,
Thanks for pointing it out. I have sent a newer version to the mailing
list. Could you please review this patch?
Thanks,
- Zheng
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-05-16 3:40 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-13 16:40 [PATCH v5] xfstests: add a new test case for ext4 indirect-based file Zheng Liu
2013-05-15 13:59 ` Rich Johnston
2013-05-15 15:31 ` Zheng Liu
2013-05-15 15:22 ` Eric Sandeen
2013-05-15 15:31 ` Eric Sandeen
2013-05-16 3:57 ` Zheng Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox