* [PATCH 1/4] xfstests: check unwritten extent preallocation in 255
2013-01-28 7:32 [PATCH 0/4] xfstests: seek data/hole and hole punching improvements Zheng Liu
@ 2013-01-28 7:32 ` Zheng Liu
2013-01-28 7:32 ` [PATCH 2/4] xfstests: 295: test fallocate hole punching for all file systems Zheng Liu
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Zheng Liu @ 2013-01-28 7:32 UTC (permalink / raw)
To: xfs, linux-ext4; +Cc: Zheng Liu, Theodore Ts'o, Dave Chinner
From: Zheng Liu <wenqing.lz@taobao.com>
255 misses call _require_xfs_io_falloc to check whether a filesystem
supports fallocate(2) to preallocate unwritten extents or not.
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Dave Chinner <david@fromorbit.com>
---
255 | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/255 b/255
index 0083963..700c3c0 100755
--- a/255
+++ b/255
@@ -1,7 +1,7 @@
#! /bin/bash
# FS QA Test No. 255
#
-# Test Generic fallocate hole punching
+# Test Generic fallocate hole punching w/ unwritten extent
#
#-----------------------------------------------------------------------
# Copyright (c) 2010 Red Hat. All Rights Reserved.
@@ -47,6 +47,7 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
_supported_fs generic
_supported_os Linux
+_require_xfs_io_falloc
_require_xfs_io_falloc_punch
_require_xfs_io_fiemap
--
1.7.12.rc2.18.g61b472e
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/4] xfstests: 295: test fallocate hole punching for all file systems
2013-01-28 7:32 [PATCH 0/4] xfstests: seek data/hole and hole punching improvements Zheng Liu
2013-01-28 7:32 ` [PATCH 1/4] xfstests: check unwritten extent preallocation in 255 Zheng Liu
@ 2013-01-28 7:32 ` Zheng Liu
2013-01-28 7:32 ` [PATCH 3/4] xfstests: check llseek(2) SEEK_DATA/HOLE and unwritten extent preallocation in 285 Zheng Liu
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Zheng Liu @ 2013-01-28 7:32 UTC (permalink / raw)
To: xfs, linux-ext4; +Cc: Zheng Liu, Theodore Ts'o, Dave Chinner
From: Zheng Liu <wenqing.lz@taobao.com>
In 255 it tries to test fallocate hole punching for a file system, but
it is only for the file system that supports to preallocate unwritten
extents.
Recently ext4 file systems will support hole punching feature for a
indirect-based file. So a new test case is created to test it. Here
this test case does the same thing like 255 except it doesn't try to
preallocate some unwritten extents. Certainly all file systems that
support hole punching feature and can preallocate unwritten extents
also survive in this test case.
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Dave Chinner <david@fromorbit.com>
---
295 | 68 ++++++++++++++
295.out | 307 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
group | 1 +
3 files changed, 376 insertions(+)
create mode 100755 295
create mode 100644 295.out
diff --git a/295 b/295
new file mode 100755
index 0000000..3df7dc8
--- /dev/null
+++ b/295
@@ -0,0 +1,68 @@
+#! /bin/bash
+# FS QA Test No. 295
+#
+# 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
+#-----------------------------------------------------------------------
+#
+# creator
+owner=wenqing.lz@taobao.com
+
+seq=`basename $0`
+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/295.$$
+
+# Standard punch hole tests
+_test_generic_punch pwrite fpunch fpunch fiemap _filter_hole_fiemap $testfile -F
+
+# Delayed allocation punch hole tests
+_test_generic_punch -d pwrite fpunch fpunch fiemap _filter_hole_fiemap $testfile -F
+
+# Multi hole punch tests
+_test_generic_punch -k pwrite fpunch fpunch fiemap _filter_hole_fiemap $testfile -F
+
+# Delayed allocation multi punch hole tests
+_test_generic_punch -d -k pwrite fpunch fpunch fiemap _filter_hole_fiemap $testfile -F
+
+# success, all done
+status=0
+exit
diff --git a/295.out b/295.out
new file mode 100644
index 0000000..c4c495f
--- /dev/null
+++ b/295.out
@@ -0,0 +1,307 @@
+QA output created by 295
+ 1. into a hole
+daa100df6e6711906b61c9ab5aa16032
+ 2. into allocated space
+0: [0..7]: extent
+1: [8..23]: hole
+2: [24..39]: extent
+cc58a7417c2d7763adc45b6fcd3fa024
+ 3. into unwritten 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
+ 5. hole -> unwritten
+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
+ 7. data -> unwritten
+0: [0..7]: extent
+1: [8..23]: hole
+2: [24..31]: extent
+3: [32..39]: hole
+5309cc2f1fc5a7f94cf52915caef35bd
+ 8. unwritten -> hole
+0: [0..7]: extent
+1: [8..39]: hole
+1b3779878366498b28c702ef88c4a773
+ 9. unwritten -> data
+0: [0..7]: extent
+1: [8..23]: hole
+2: [24..31]: extent
+3: [32..39]: hole
+5309cc2f1fc5a7f94cf52915caef35bd
+ 10. hole -> data -> hole
+daa100df6e6711906b61c9ab5aa16032
+ 11. data -> hole -> data
+0: [0..7]: extent
+1: [8..31]: hole
+2: [32..39]: extent
+f6aeca13ec49e5b266cd1c913cd726e3
+ 12. unwritten -> data -> unwritten
+0: [0..7]: extent
+1: [8..31]: hole
+2: [32..39]: extent
+f6aeca13ec49e5b266cd1c913cd726e3
+ 13. data -> unwritten -> 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
+ 3. into unwritten 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
+ 5. hole -> unwritten
+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
+ 7. data -> unwritten
+0: [0..7]: extent
+1: [8..23]: hole
+2: [24..31]: extent
+3: [32..39]: hole
+5309cc2f1fc5a7f94cf52915caef35bd
+ 8. unwritten -> hole
+0: [0..7]: extent
+1: [8..39]: hole
+1b3779878366498b28c702ef88c4a773
+ 9. unwritten -> data
+0: [0..7]: extent
+1: [8..23]: hole
+2: [24..31]: extent
+3: [32..39]: hole
+5309cc2f1fc5a7f94cf52915caef35bd
+ 10. hole -> data -> hole
+daa100df6e6711906b61c9ab5aa16032
+ 11. data -> hole -> data
+0: [0..7]: extent
+1: [8..31]: hole
+2: [32..39]: extent
+f6aeca13ec49e5b266cd1c913cd726e3
+ 12. unwritten -> data -> unwritten
+0: [0..7]: extent
+1: [8..31]: hole
+2: [32..39]: extent
+f6aeca13ec49e5b266cd1c913cd726e3
+ 13. data -> unwritten -> 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
+ 3. into unwritten 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
+ 5. hole -> unwritten
+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
+ 7. data -> unwritten
+0: [0..7]: extent
+1: [8..23]: hole
+2: [24..39]: extent
+cc58a7417c2d7763adc45b6fcd3fa024
+ 8. unwritten -> hole
+0: [0..7]: extent
+1: [8..23]: hole
+2: [24..39]: extent
+cc58a7417c2d7763adc45b6fcd3fa024
+ 9. unwritten -> data
+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
+ 12. unwritten -> data -> unwritten
+0: [0..7]: extent
+1: [8..31]: hole
+2: [32..39]: extent
+f6aeca13ec49e5b266cd1c913cd726e3
+ 13. data -> unwritten -> 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
+ 3. into unwritten 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
+ 5. hole -> unwritten
+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
+ 7. data -> unwritten
+0: [0..7]: extent
+1: [8..23]: hole
+2: [24..39]: extent
+cc58a7417c2d7763adc45b6fcd3fa024
+ 8. unwritten -> hole
+0: [0..7]: extent
+1: [8..23]: hole
+2: [24..39]: extent
+cc58a7417c2d7763adc45b6fcd3fa024
+ 9. unwritten -> data
+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
+ 12. unwritten -> data -> unwritten
+0: [0..7]: extent
+1: [8..31]: hole
+2: [32..39]: extent
+f6aeca13ec49e5b266cd1c913cd726e3
+ 13. data -> unwritten -> 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/group b/group
index 505bc7f..a07d7f3 100644
--- a/group
+++ b/group
@@ -413,3 +413,4 @@ deprecated
292 auto mkfs quick
293 auto quick
294 auto quick
+295 auto quick prealloc
--
1.7.12.rc2.18.g61b472e
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/4] xfstests: check llseek(2) SEEK_DATA/HOLE and unwritten extent preallocation in 285
2013-01-28 7:32 [PATCH 0/4] xfstests: seek data/hole and hole punching improvements Zheng Liu
2013-01-28 7:32 ` [PATCH 1/4] xfstests: check unwritten extent preallocation in 255 Zheng Liu
2013-01-28 7:32 ` [PATCH 2/4] xfstests: 295: test fallocate hole punching for all file systems Zheng Liu
@ 2013-01-28 7:32 ` Zheng Liu
2013-01-28 7:32 ` [PATCH 4/4] xfstests: 296: add a seek data/hole test w/o unwritten extent Zheng Liu
2013-02-05 15:39 ` [PATCH 0/4] xfstests: seek data/hole and hole punching improvements Mark Tinguely
4 siblings, 0 replies; 7+ messages in thread
From: Zheng Liu @ 2013-01-28 7:32 UTC (permalink / raw)
To: xfs, linux-ext4; +Cc: Zheng Liu, Theodore Ts'o, Dave Chinner
From: Zheng Liu <wenqing.lz@taobao.com>
In 285 it has its own check for seek data/hole support. This commit
turns into an equivalent _require_seek_data_hole.
Meanwhile in 285 it doesn't check unwritten extent preallocation. Now
ext4 file system has supported seek data/hole for a file w/o unwritten
extent. Thus, in 285, it needs to call the _require_xfs_io_falloc to
check unwritten extent prealloction.
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Dave Chinner <david@fromorbit.com>
---
285 | 7 +++++--
common.rc | 12 ++++++++++++
src/seek_sanity_test.c | 18 +++++++++++++-----
3 files changed, 30 insertions(+), 7 deletions(-)
mode change 100644 => 100755 285
diff --git a/285 b/285
old mode 100644
new mode 100755
index a18fc71..6224673
--- a/285
+++ b/285
@@ -1,7 +1,7 @@
#! /bin/bash
# FS QA Test No. 285
#
-# SEEK_DATA/SEEK_HOLE sanity tests.
+# SEEK_DATA/SEEK_HOLE sanity tests w/ unwritten extent.
#
# Improved by Jeff.liu@oracle.com
# Creater: josef@redhat.com
@@ -41,9 +41,12 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_supported_fs generic
_supported_os Linux
+_require_seek_data_hole
+_require_xfs_io_falloc
+
BASE_TEST_FILE=$TEST_DIR/seek_sanity_testfile
-[ -x $here/src/seek_sanity_test ] || _notrun "seek_sanitfy_tester not built"
+[ -x $here/src/seek_sanity_test ] || _notrun "seek_sanity_tester not built"
_cleanup()
{
diff --git a/common.rc b/common.rc
index 2e8581e..35a5f52 100644
--- a/common.rc
+++ b/common.rc
@@ -1049,6 +1049,18 @@ _require_sparse_files()
esac
}
+#
+# Check if the filesystem supports seek_data/hole.
+#
+_require_seek_data_hole()
+{
+ testfile=$TEST_DIR/$$.seek
+ testseek=`$here/src/seek_sanity_test -t $testfile 2>&1`
+ rm -f $testfile 2>&1 > /dev/null
+ echo $testseek | grep -q "Kernel does not support" && \
+ _notrun "File system does not support llseek(2) SEEK_DATA/HOLE"
+}
+
# check that a FS on a device is mounted
# if so, return mount point
#
diff --git a/src/seek_sanity_test.c b/src/seek_sanity_test.c
index 3897f02..b1ef006 100644
--- a/src/seek_sanity_test.c
+++ b/src/seek_sanity_test.c
@@ -660,17 +660,25 @@ int main(int argc, char **argv)
{
int ret = -1;
int i = 0;
+ int opt;
+ int check_support = 0;
int numtests = sizeof(seek_tests) / sizeof(struct testrec);
- if (argc != 2) {
- fprintf(stdout, "Usage: %s base_file_path\n", argv[0]);
- return ret;
+ while ((opt = getopt(argc, argv, "t")) != -1) {
+ switch (opt) {
+ case 't':
+ check_support++;
+ break;
+ default:
+ fprintf(stdout, "Usage: %s [-t] base_file_path\n", argv[0]);
+ return ret;
+ }
}
- base_file_path = (char *)strdup(argv[1]);
+ base_file_path = (char *)strdup(argv[optind]);
ret = test_basic_support();
- if (ret)
+ if (ret || check_support)
goto out;
for (i = 0; i < numtests; ++i) {
--
1.7.12.rc2.18.g61b472e
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/4] xfstests: 296: add a seek data/hole test w/o unwritten extent
2013-01-28 7:32 [PATCH 0/4] xfstests: seek data/hole and hole punching improvements Zheng Liu
` (2 preceding siblings ...)
2013-01-28 7:32 ` [PATCH 3/4] xfstests: check llseek(2) SEEK_DATA/HOLE and unwritten extent preallocation in 285 Zheng Liu
@ 2013-01-28 7:32 ` Zheng Liu
2013-02-05 15:39 ` [PATCH 0/4] xfstests: seek data/hole and hole punching improvements Mark Tinguely
4 siblings, 0 replies; 7+ messages in thread
From: Zheng Liu @ 2013-01-28 7:32 UTC (permalink / raw)
To: xfs, linux-ext4; +Cc: Zheng Liu, Theodore Ts'o, Dave Chinner
From: Zheng Liu <wenqing.lz@taobao.com>
Now ext4 has supported seek data/hole w/o unwritten extent. This commit
creates a new test case to do seek data/hole sanity test w/o unwritten
extent. All file systems that support seek_data/hole should survive
after running this test.
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Dave Chinner <david@fromorbit.com>
---
296 | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++
296.out | 1 +
group | 1 +
src/seek_sanity_test.c | 30 +++++++++++++++++++++-----
4 files changed, 84 insertions(+), 5 deletions(-)
create mode 100755 296
create mode 100644 296.out
diff --git a/296 b/296
new file mode 100755
index 0000000..8a49a0f
--- /dev/null
+++ b/296
@@ -0,0 +1,57 @@
+#! /bin/bash
+# FS QA Test No. 296
+#
+# SEEK_DATA/SEEK_HOLE sanity test 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
+#-----------------------------------------------------------------------
+#
+# creator
+owner=wenqing.lz@taobao.com
+
+seq=`basename $0`
+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()
+{
+ eval "rm -f $BASE_TEST_FILE.*"
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_supported_fs generic
+_supported_os IRIX Linux
+
+_require_seek_data_hole
+
+BASE_TEST_FILE=$TEST_DIR/seek_sanity_testfile
+
+[ -x $here/src/seek_sanity_test ] || _notrun "seek_sanity_tester not built"
+
+$here/src/seek_sanity_test -u $BASE_TEST_FILE > $seq.full 2>&1 ||
+ _fail "seek sanity check failed!"
+
+# success, all done
+status=0
+exit
diff --git a/296.out b/296.out
new file mode 100644
index 0000000..7921f57
--- /dev/null
+++ b/296.out
@@ -0,0 +1 @@
+QA output created by 296
diff --git a/group b/group
index a07d7f3..3019924 100644
--- a/group
+++ b/group
@@ -414,3 +414,4 @@ deprecated
293 auto quick
294 auto quick
295 auto quick prealloc
+296 auto rw
diff --git a/src/seek_sanity_test.c b/src/seek_sanity_test.c
index b1ef006..bfa5e52 100644
--- a/src/seek_sanity_test.c
+++ b/src/seek_sanity_test.c
@@ -567,7 +567,16 @@ struct testrec {
char *test_desc;
};
-struct testrec seek_tests[] = {
+struct testrec no_unwritten_seek_tests[] = {
+ { 1, test01, "Test empty file" },
+ { 2, test02, "Test a tiny full file" },
+ { 3, test03, "Test a larger full file" },
+ { 4, test04, "Test file hole at beg, data at end" },
+ { 5, test05, "Test file data at beg, hole at end" },
+ { 6, test06, "Test file hole data hole data" },
+};
+
+struct testrec full_seek_tests[] = {
{ 1, test01, "Test empty file" },
{ 2, test02, "Test a tiny full file" },
{ 3, test03, "Test a larger full file" },
@@ -662,15 +671,20 @@ int main(int argc, char **argv)
int i = 0;
int opt;
int check_support = 0;
- int numtests = sizeof(seek_tests) / sizeof(struct testrec);
+ int dont_unwritten = 0;
+ int numtests = sizeof(full_seek_tests) / sizeof(struct testrec);
+ struct testrec *tests = full_seek_tests;
- while ((opt = getopt(argc, argv, "t")) != -1) {
+ while ((opt = getopt(argc, argv, "tu")) != -1) {
switch (opt) {
case 't':
check_support++;
break;
+ case 'u':
+ dont_unwritten++;
+ break;
default:
- fprintf(stdout, "Usage: %s [-t] base_file_path\n", argv[0]);
+ fprintf(stdout, "Usage: %s [-tu] base_file_path\n", argv[0]);
return ret;
}
}
@@ -681,8 +695,14 @@ int main(int argc, char **argv)
if (ret || check_support)
goto out;
+ if (dont_unwritten) {
+ numtests = sizeof(no_unwritten_seek_tests) /
+ sizeof(struct testrec);
+ tests = no_unwritten_seek_tests;
+ }
+
for (i = 0; i < numtests; ++i) {
- ret = run_test(&seek_tests[i]);
+ ret = run_test(&tests[i]);
if (ret)
break;
}
--
1.7.12.rc2.18.g61b472e
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 0/4] xfstests: seek data/hole and hole punching improvements
2013-01-28 7:32 [PATCH 0/4] xfstests: seek data/hole and hole punching improvements Zheng Liu
` (3 preceding siblings ...)
2013-01-28 7:32 ` [PATCH 4/4] xfstests: 296: add a seek data/hole test w/o unwritten extent Zheng Liu
@ 2013-02-05 15:39 ` Mark Tinguely
2013-02-06 2:42 ` Zheng Liu
4 siblings, 1 reply; 7+ messages in thread
From: Mark Tinguely @ 2013-02-05 15:39 UTC (permalink / raw)
To: Zheng Liu; +Cc: xfs, linux-ext4, Theodore Ts'o, Zheng Liu, Jie Liu
On 01/28/13 01:32, Zheng Liu wrote:
> Hi all,
>
> Here is my first try to improve seek data/hole and hole punching test
> cases in xfstests. The key issue in 255 and 285 is that they assume that
> all file systems that are tested support unwritten extent preallocation.
> Before 3.8 kernel it is correct. But now ext4 file system has ability
> to seek data/hole and punch a hole for a file w/o unwritten extent. So
> it is time to improve these test cases.
>
> In this patch series it calls _require_xfs_io_falloc in 255 and 285 to
> make sure that unwritten extent is supprted by tested file system. A
> new argument '-t' is added into seek_sanity_test to check a file system
> that supports seek data/hole or not. In the mean time _require_seek_data_hole
> is defined to be used by all tests.
>
> Further two new test cases are created to test seek data/hole and hole
> punching w/o unwritten extent, which do the same thing like 255 and 285
> except that they don't do some test cases which are related to unwritten
> extent.
>
> Any comments or feedbacks are welcome.
>
> Thanks,
> - Zheng
Hi Zheng,
I wonder if reviving the idea of putting the SEEK_DATA/SEEK_HOLE
feature into xfs_io would simplify the existing tests and future ones.
My last version of the SEEK_DATA/SEEK_HOLE xfs_io extension should be
sightly changed to make the hole only test output to be consistent with
the data test; namely, it should end with an EOF entry.
http://oss.sgi.com/archives/xfs/2012-11/msg00106.html
I know there will be some result filtering needed for holes which the C
program based tests already provide.
Just a thought.
--Mark.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/4] xfstests: seek data/hole and hole punching improvements
2013-02-05 15:39 ` [PATCH 0/4] xfstests: seek data/hole and hole punching improvements Mark Tinguely
@ 2013-02-06 2:42 ` Zheng Liu
0 siblings, 0 replies; 7+ messages in thread
From: Zheng Liu @ 2013-02-06 2:42 UTC (permalink / raw)
To: Mark Tinguely; +Cc: xfs, linux-ext4, Theodore Ts'o, Zheng Liu, Jie Liu
On Tue, Feb 05, 2013 at 09:39:46AM -0600, Mark Tinguely wrote:
> On 01/28/13 01:32, Zheng Liu wrote:
> >Hi all,
> >
> >Here is my first try to improve seek data/hole and hole punching test
> >cases in xfstests. The key issue in 255 and 285 is that they assume that
> >all file systems that are tested support unwritten extent preallocation.
> >Before 3.8 kernel it is correct. But now ext4 file system has ability
> >to seek data/hole and punch a hole for a file w/o unwritten extent. So
> >it is time to improve these test cases.
> >
> >In this patch series it calls _require_xfs_io_falloc in 255 and 285 to
> >make sure that unwritten extent is supprted by tested file system. A
> >new argument '-t' is added into seek_sanity_test to check a file system
> >that supports seek data/hole or not. In the mean time _require_seek_data_hole
> >is defined to be used by all tests.
> >
> >Further two new test cases are created to test seek data/hole and hole
> >punching w/o unwritten extent, which do the same thing like 255 and 285
> >except that they don't do some test cases which are related to unwritten
> >extent.
> >
> >Any comments or feedbacks are welcome.
> >
> >Thanks,
> > - Zheng
>
> Hi Zheng,
>
> I wonder if reviving the idea of putting the SEEK_DATA/SEEK_HOLE
> feature into xfs_io would simplify the existing tests and future ones.
>
> My last version of the SEEK_DATA/SEEK_HOLE xfs_io extension should be
> sightly changed to make the hole only test output to be consistent with
> the data test; namely, it should end with an EOF entry.
>
> http://oss.sgi.com/archives/xfs/2012-11/msg00106.html
>
> I know there will be some result filtering needed for holes which the C
> program based tests already provide.
Hi Mark,
Thanks for your comment. I am fine with your idea of using xfs_io to
seek data/hole. In next version I will try to use xfs_io to implement
_require_seek_data_hole().
Regards,
- Zheng
^ permalink raw reply [flat|nested] 7+ messages in thread