diff mbox

[1/3] 285: Fix test for ext4 in some configurations

Message ID 1369917939-22660-1-git-send-email-jack@suse.cz
State Not Applicable, archived
Headers show

Commit Message

Jan Kara May 30, 2013, 12:45 p.m. UTC
In some configurations (e.g. 1 KB block size), ext4 can decide it is
better to zero out several blocks rather than splitting unwritten
extent. This changes results SEEK_HOLE / SEEK_DATA returns and thus the
test fails. Fix the problem by disabling the feature for this test.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 tests/generic/285 | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Eric Sandeen May 30, 2013, 1:45 p.m. UTC | #1
On 5/30/13 7:45 AM, Jan Kara wrote:
> In some configurations (e.g. 1 KB block size), ext4 can decide it is
> better to zero out several blocks rather than splitting unwritten
> extent. This changes results SEEK_HOLE / SEEK_DATA returns and thus the
> test fails. Fix the problem by disabling the feature for this test.
> 
> Signed-off-by: Jan Kara <jack@suse.cz>
> ---
>  tests/generic/285 | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/tests/generic/285 b/tests/generic/285
> index b700a15..8078b1c 100755
> --- a/tests/generic/285
> +++ b/tests/generic/285
> @@ -46,6 +46,12 @@ BASE_TEST_FILE=$TEST_DIR/seek_sanity_testfile
>  
>  [ -x $here/src/seek_sanity_test ] || _notrun "seek_sanitfy_tester not built"
>  
> +# Disable extent zeroing for ext4 as that change where holes are created
> +if [ "$FSTYP" = "ext4" ]; then
> +	DEV=`basename $TEST_DEV`
> +	echo 0 >/sys/fs/ext4/$DEV/extent_max_zeroout_kb
> +fi
> +
>  _cleanup()
>  {
>  	eval "rm -f $BASE_TEST_FILE.*"
> 

When the test dev is unmounted & remounted this will be reset, right?  So:

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dave Chinner May 30, 2013, 10:30 p.m. UTC | #2
On Thu, May 30, 2013 at 02:45:37PM +0200, Jan Kara wrote:
> In some configurations (e.g. 1 KB block size), ext4 can decide it is
> better to zero out several blocks rather than splitting unwritten
> extent. This changes results SEEK_HOLE / SEEK_DATA returns and thus the
> test fails. Fix the problem by disabling the feature for this test.
> 
> Signed-off-by: Jan Kara <jack@suse.cz>
> ---
>  tests/generic/285 | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/tests/generic/285 b/tests/generic/285
> index b700a15..8078b1c 100755
> --- a/tests/generic/285
> +++ b/tests/generic/285
> @@ -46,6 +46,12 @@ BASE_TEST_FILE=$TEST_DIR/seek_sanity_testfile
>  
>  [ -x $here/src/seek_sanity_test ] || _notrun "seek_sanitfy_tester not built"
>  
> +# Disable extent zeroing for ext4 as that change where holes are created
> +if [ "$FSTYP" = "ext4" ]; then
> +	DEV=`basename $TEST_DEV`
> +	echo 0 >/sys/fs/ext4/$DEV/extent_max_zeroout_kb
> +fi

would that be better going into _require_seek_data_hole so that 286
also picks up this behaviour for ext4?

Cheers,

Dave.
Jan Kara May 31, 2013, 8:10 a.m. UTC | #3
On Fri 31-05-13 08:30:00, Dave Chinner wrote:
> On Thu, May 30, 2013 at 02:45:37PM +0200, Jan Kara wrote:
> > In some configurations (e.g. 1 KB block size), ext4 can decide it is
> > better to zero out several blocks rather than splitting unwritten
> > extent. This changes results SEEK_HOLE / SEEK_DATA returns and thus the
> > test fails. Fix the problem by disabling the feature for this test.
> > 
> > Signed-off-by: Jan Kara <jack@suse.cz>
> > ---
> >  tests/generic/285 | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/tests/generic/285 b/tests/generic/285
> > index b700a15..8078b1c 100755
> > --- a/tests/generic/285
> > +++ b/tests/generic/285
> > @@ -46,6 +46,12 @@ BASE_TEST_FILE=$TEST_DIR/seek_sanity_testfile
> >  
> >  [ -x $here/src/seek_sanity_test ] || _notrun "seek_sanitfy_tester not built"
> >  
> > +# Disable extent zeroing for ext4 as that change where holes are created
> > +if [ "$FSTYP" = "ext4" ]; then
> > +	DEV=`basename $TEST_DEV`
> > +	echo 0 >/sys/fs/ext4/$DEV/extent_max_zeroout_kb
> > +fi
> 
> would that be better going into _require_seek_data_hole so that 286
> also picks up this behaviour for ext4?
  Actually, thinking about it, test 286 doesn't need extent_max_zeroout_kb
set. It just compares file sizes / used blocks are the same and they really
should be regardless of extent_max_zeroout_kb setting. It is even desirable
to test this with the default extent_max_zeroout_kb setting...

								Honza
diff mbox

Patch

diff --git a/tests/generic/285 b/tests/generic/285
index b700a15..8078b1c 100755
--- a/tests/generic/285
+++ b/tests/generic/285
@@ -46,6 +46,12 @@  BASE_TEST_FILE=$TEST_DIR/seek_sanity_testfile
 
 [ -x $here/src/seek_sanity_test ] || _notrun "seek_sanitfy_tester not built"
 
+# Disable extent zeroing for ext4 as that change where holes are created
+if [ "$FSTYP" = "ext4" ]; then
+	DEV=`basename $TEST_DEV`
+	echo 0 >/sys/fs/ext4/$DEV/extent_max_zeroout_kb
+fi
+
 _cleanup()
 {
 	eval "rm -f $BASE_TEST_FILE.*"