285: Fix test for ext4 in some configurations
PATCH 1/3 285: Fix test for ext4 in some configurations
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.
--- tests/generic/285 | 6 ++++++ 1 file changed, 6 insertions(+)
tests/generic/285 +6 -0
@@ -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.*"
Signature · 1 line
1.8.1.4
PATCH 2/3 285: Fix file syncing
The intention of tests 08 and 09 in test generic/285 is to sync the whole file before checking for data and holes. However the helper is called with nbytes argument set to 0 which results in not syncing anything. Set nbytes properly.
--- src/seek_sanity_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
src/seek_sanity_test.c +2 -2
@@ -229,7 +229,7 @@ static int test09(int fd, int testnum)* Sync out dirty pages from bufsz * 100, this will convert * the dirty page to writeback. */ - ret =do_sync_dirty_pages (fd, bufsz *100 ,0 ); + ret =do_sync_dirty_pages (fd, bufsz *100 , filsz);if (ret) goto out;
@@ -269,7 +269,7 @@ static int test08(int fd, int testnum) goto out;/* Sync out all file */ - ret =do_sync_dirty_pages (fd,0 ,0 ); + ret =do_sync_dirty_pages (fd,0 , filsz);if (ret) goto out;
Signature · 1 line
1.8.1.4
PATCH 3/3 285: Test offsets over 4GB
In reply to Jan KaraTest whether SEEK_HOLE and SEEK_DATA works correctly with offsets over 4GB.
--- src/seek_sanity_test.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+)
src/seek_sanity_test.c +38 -0
@@ -18,6 +18,7 @@*/ #define _XOPEN_SOURCE 500 +#define _FILE_OFFSET_BITS 64#include <sys/types.h> #include <sys/stat.h> #include <sys/vfs.h>
@@ -191,6 +192,42 @@ static int do_lseek(int testnum, int subtest, int fd, int filsz, int origin,return ret; } +/* test a huge file to check for 4G overflows */ +static int test10 (int fd,int testnum) +{ +char *buf =NULL ; +int bufsz = alloc_size; +off_t filsz =8ULL <<30 ;/* 8G */ +off_t off = filsz -2 *bufsz; +int ret =-1 ; + + buf =do_malloc (bufsz); +if (!buf) + goto out; +memset (buf,'a' , bufsz); + + ret =do_pwrite (fd, buf, bufsz,0 ); +if (ret) + goto out; + ret =do_pwrite (fd, buf, bufsz, off); +if (ret) + goto out; + +/* offset at the beginning */ + ret +=do_lseek (testnum,1 , fd, filsz,SEEK_HOLE ,0 , bufsz); + ret +=do_lseek (testnum,2 , fd, filsz,SEEK_HOLE ,1 , bufsz); + ret +=do_lseek (testnum,3 , fd, filsz,SEEK_DATA ,0 ,0 ); + ret +=do_lseek (testnum,4 , fd, filsz,SEEK_DATA ,1 ,1 ); + +/* offset around eof */ + ret +=do_lseek (testnum,5 , fd, filsz,SEEK_HOLE , off, off + bufsz); + ret +=do_lseek (testnum,6 , fd, filsz,SEEK_DATA , off, off); + ret +=do_lseek (testnum,7 , fd, filsz,SEEK_DATA , off +1 , off +1 ); + +out: +do_free (buf); +return ret; +}/* * test file with unwritten extents, have both dirty and * writeback pages in page cache.
@@ -577,6 +614,7 @@ struct testrec seek_tests[] = { { 7, test07, "Test file with unwritten extents, only have dirty pages" }, { 8, test08, "Test file with unwritten extents, only have unwritten pages" }, { 9, test09, "Test file with unwritten extents, have both dirty && unwritten pages" }, + { 10, test10, "Test a huge file" }, };static int run_test (struct testrec *tr)
Signature · 1 line
1.8.1.4
Quoted 18 lines · Jan Kara
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_DATAreturns and thus the test fails. Fix the problem by disabling the feature for this test.Signed-off-by Jan Kara <[email protected]>--- tests/generic/285 | 6 ++++++ 1 file changed, 6 insertions(+)tests/generic/285 +0
-0@@ -46,6 +46,12 @@ BASE_TEST_FILE=$TEST_DIR/seek_sanity_testfile [ -x $here/src/seek_sanity_test ] || _notrun "seek_sanitfy_tester not built"
tests/generic/285 BASE_TEST_FILE=$TEST_DIR/seek_sanity_testfile · line 57
Quoted 10 lines
tests/generic/285 +6
-0+# 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:
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 2/3] 285: Fix file syncing
In reply to Jan KaraQuoted 4 lines · Jan Kara
The intention of tests 08 and 09 in test generic/285 is to sync the whole file before checking for data and holes. However the helper is called with nbytes argument set to 0 which results in not syncing anything. Set nbytes properly.
Hm, are you sure? (Is the man page wrong, or is the sync_file_range implementation wrong?)
DESCRIPTION
sync_file_range() permits fine control when synchronizing the open file referred to by the file descriptor fd with disk.
offset is the starting byte of the file range to be synchro-
nized. nbytes specifies the length of the range to be synchro-
nized, in bytes; if nbytes is zero, then all bytes from offset through to the end of file are synchronized.
-Eric
Quoted 28 lines
Signed-off-by Jan Kara <[email protected]>--- src/seek_sanity_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)src/seek_sanity_test.c +2
-2@@ -229,7 +229,7 @@ static int test09(int fd, int testnum)* Sync out dirty pages from bufsz * 100, this will convert * the dirty page to writeback. */ - ret =do_sync_dirty_pages (fd, bufsz *100 ,0 ); + ret =do_sync_dirty_pages (fd, bufsz *100 , filsz);if (ret) goto out;@@ -269,7 +269,7 @@ static int test08(int fd, int testnum) goto out;/* Sync out all file */ - ret =do_sync_dirty_pages (fd,0 ,0 ); + ret =do_sync_dirty_pages (fd,0 , filsz);if (ret) goto out;
Re: [PATCH 3/3] 285: Test offsets over 4GB
In reply to Jan KaraQuoted 2 lines · Jan Kara
Test whether
SEEK_HOLEandSEEK_DATAworks correctly with offsets over 4GB.
Hm, should we add 2T as well while we're at it?
(and does this cause any new failures?)
-Eric
Quoted 62 lines
Signed-off-by Jan Kara <[email protected]>--- src/seek_sanity_test.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+)src/seek_sanity_test.c +37
-0@@ -18,6 +18,7 @@*/ #define _XOPEN_SOURCE 500 +#define _FILE_OFFSET_BITS 64#include <sys/types.h> #include <sys/stat.h> #include <sys/vfs.h> @@ -191,6 +192,42 @@ static int do_lseek(int testnum, int subtest, int fd, int filsz, int origin,return ret; } +/* test a huge file to check for 4G overflows */ +static int test10 (int fd,int testnum) +{ +char *buf =NULL ; +int bufsz = alloc_size; +off_t filsz =8ULL <<30 ;/* 8G */ +off_t off = filsz -2 *bufsz; +int ret =-1 ; + + buf =do_malloc (bufsz); +if (!buf) + goto out; +memset (buf,'a' , bufsz); + + ret =do_pwrite (fd, buf, bufsz,0 ); +if (ret) + goto out; + ret =do_pwrite (fd, buf, bufsz, off); +if (ret) + goto out; + +/* offset at the beginning */ + ret +=do_lseek (testnum,1 , fd, filsz,SEEK_HOLE ,0 , bufsz); + ret +=do_lseek (testnum,2 , fd, filsz,SEEK_HOLE ,1 , bufsz); + ret +=do_lseek (testnum,3 , fd, filsz,SEEK_DATA ,0 ,0 ); + ret +=do_lseek (testnum,4 , fd, filsz,SEEK_DATA ,1 ,1 ); + +/* offset around eof */ + ret +=do_lseek (testnum,5 , fd, filsz,SEEK_HOLE , off, off + bufsz); + ret +=do_lseek (testnum,6 , fd, filsz,SEEK_DATA , off, off); + ret +=do_lseek (testnum,7 , fd, filsz,SEEK_DATA , off +1 , off +1 ); + +out: +do_free (buf); +return ret; +}/* * test file with unwritten extents, have both dirty and * writeback pages in page cache.
src/seek_sanity_test.c struct testrec seek_tests[] = { · line 620
Quoted 7 lines
src/seek_sanity_test.c +1
-0@@ -577,6 +614,7 @@ struct testrec seek_tests[] = { { 7, test07, "Test file with unwritten extents, only have dirty pages" }, { 8, test08, "Test file with unwritten extents, only have unwritten pages" }, { 9, test09, "Test file with unwritten extents, have both dirty && unwritten pages" }, + { 10, test10, "Test a huge file" }, };static int run_test (struct testrec *tr)
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 2/3] 285: Fix file syncing
In reply to Eric SandeenQuoted 9 lines · Eric Sandeen
Quoted 4 lines · Jan Kara
The intention of tests 08 and 09 in test generic/285 is to sync the whole file before checking for data and holes. However the helper is called with nbytes argument set to 0 which results in not syncing anything. Set nbytes properly.
Hm, are you sure? (Is the man page wrong, or is the
sync_file_rangeimplementation wrong?)
Quoted 8 lines
DESCRIPTION
sync_file_range()permits fine control when synchronizing the open file referred to by the file descriptor fd with disk.offset is the starting byte of the file range to be synchro-
nized. nbytes specifies the length of the range to be synchro-
nized, in bytes; if nbytes is zero, then all bytes from offset through to the end of file are synchronized.
My fault that I didn't read the manpage carefully enough. Scratch this
patch.
Honza
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Re: [PATCH 3/3] 285: Test offsets over 4GB
In reply to Eric SandeenQuoted 8 lines · Eric Sandeen
Quoted 2 lines · Jan Kara
Test whether
SEEK_HOLEandSEEK_DATAworks correctly with offsets over 4GB.Hm, should we add 2T as well while we're at it?
(and does this cause any new failures?)
Yes, ext4 is broken. I've sent fixes for it yesterday. I'm not sure what
exactly would overflow at 2T ... block counts if signed int is used and blocksize is 1KB?
Honza
Quoted 70 lines
Quoted 69 lines
Signed-off-by Jan Kara <[email protected]>--- src/seek_sanity_test.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+)src/seek_sanity_test.c +38
-0@@ -18,6 +18,7 @@*/ #define _XOPEN_SOURCE 500 +#define _FILE_OFFSET_BITS 64#include <sys/types.h> #include <sys/stat.h> #include <sys/vfs.h> @@ -191,6 +192,42 @@ static int do_lseek(int testnum, int subtest, int fd, int filsz, int origin,return ret; } +/* test a huge file to check for 4G overflows */ +static int test10 (int fd,int testnum) +{ +char *buf =NULL ; +int bufsz = alloc_size; +off_t filsz =8ULL <<30 ;/* 8G */ +off_t off = filsz -2 *bufsz; +int ret =-1 ; + + buf =do_malloc (bufsz); +if (!buf) + goto out; +memset (buf,'a' , bufsz); + + ret =do_pwrite (fd, buf, bufsz,0 ); +if (ret) + goto out; + ret =do_pwrite (fd, buf, bufsz, off); +if (ret) + goto out; + +/* offset at the beginning */ + ret +=do_lseek (testnum,1 , fd, filsz,SEEK_HOLE ,0 , bufsz); + ret +=do_lseek (testnum,2 , fd, filsz,SEEK_HOLE ,1 , bufsz); + ret +=do_lseek (testnum,3 , fd, filsz,SEEK_DATA ,0 ,0 ); + ret +=do_lseek (testnum,4 , fd, filsz,SEEK_DATA ,1 ,1 ); + +/* offset around eof */ + ret +=do_lseek (testnum,5 , fd, filsz,SEEK_HOLE , off, off + bufsz); + ret +=do_lseek (testnum,6 , fd, filsz,SEEK_DATA , off, off); + ret +=do_lseek (testnum,7 , fd, filsz,SEEK_DATA , off +1 , off +1 ); + +out: +do_free (buf); +return ret; +}/* * test file with unwritten extents, have both dirty and * writeback pages in page cache. @@ -577,6 +614,7 @@ struct testrec seek_tests[] = { { 7, test07, "Test file with unwritten extents, only have dirty pages" }, { 8, test08, "Test file with unwritten extents, only have unwritten pages" }, { 9, test09, "Test file with unwritten extents, have both dirty && unwritten pages" }, + { 10, test10, "Test a huge file" }, };static int run_test (struct testrec *tr)
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Re: [PATCH 3/3] 285: Test offsets over 4GB
Quoted 10 lines · Jan Kara
Quoted 8 lines · Eric Sandeen
Quoted 2 lines · Jan Kara
Test whether
SEEK_HOLEandSEEK_DATAworks correctly with offsets over 4GB.Hm, should we add 2T as well while we're at it?
(and does this cause any new failures?)
Yes, ext4 is broken. I've sent fixes for it yesterday. I'm not sure what
Argh, sorry I forgot that. I just want to be careful about more rigorous tests making it look like we have regressions in the code.
Quoted 2 lines
exactly would overflow at 2T ... block counts if signed int is used and blocksize is 1KB?
Hum ok, where'd I come up with 2T? :) never mind that maybe, unless there are other potential trouble points we should add (8T? 16T for filesystems that can handle it?)
-Eric
Quoted 72 lines
Honza
Quoted 70 lines
Quoted 69 lines
Signed-off-by Jan Kara <[email protected]>--- src/seek_sanity_test.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+)src/seek_sanity_test.c +38
-0@@ -18,6 +18,7 @@*/ #define _XOPEN_SOURCE 500 +#define _FILE_OFFSET_BITS 64#include <sys/types.h> #include <sys/stat.h> #include <sys/vfs.h> @@ -191,6 +192,42 @@ static int do_lseek(int testnum, int subtest, int fd, int filsz, int origin,return ret; } +/* test a huge file to check for 4G overflows */ +static int test10 (int fd,int testnum) +{ +char *buf =NULL ; +int bufsz = alloc_size; +off_t filsz =8ULL <<30 ;/* 8G */ +off_t off = filsz -2 *bufsz; +int ret =-1 ; + + buf =do_malloc (bufsz); +if (!buf) + goto out; +memset (buf,'a' , bufsz); + + ret =do_pwrite (fd, buf, bufsz,0 ); +if (ret) + goto out; + ret =do_pwrite (fd, buf, bufsz, off); +if (ret) + goto out; + +/* offset at the beginning */ + ret +=do_lseek (testnum,1 , fd, filsz,SEEK_HOLE ,0 , bufsz); + ret +=do_lseek (testnum,2 , fd, filsz,SEEK_HOLE ,1 , bufsz); + ret +=do_lseek (testnum,3 , fd, filsz,SEEK_DATA ,0 ,0 ); + ret +=do_lseek (testnum,4 , fd, filsz,SEEK_DATA ,1 ,1 ); + +/* offset around eof */ + ret +=do_lseek (testnum,5 , fd, filsz,SEEK_HOLE , off, off + bufsz); + ret +=do_lseek (testnum,6 , fd, filsz,SEEK_DATA , off, off); + ret +=do_lseek (testnum,7 , fd, filsz,SEEK_DATA , off +1 , off +1 ); + +out: +do_free (buf); +return ret; +}/* * test file with unwritten extents, have both dirty and * writeback pages in page cache. @@ -577,6 +614,7 @@ struct testrec seek_tests[] = { { 7, test07, "Test file with unwritten extents, only have dirty pages" }, { 8, test08, "Test file with unwritten extents, only have unwritten pages" }, { 9, test09, "Test file with unwritten extents, have both dirty && unwritten pages" }, + { 10, test10, "Test a huge file" }, };static int run_test (struct testrec *tr)
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 3/3] 285: Test offsets over 4GB
Quoted 15 lines · Eric Sandeen
Quoted 10 lines · Jan Kara
Quoted 8 lines · Eric Sandeen
Quoted 2 lines · Jan Kara
Test whether
SEEK_HOLEandSEEK_DATAworks correctly with offsets over 4GB.Hm, should we add 2T as well while we're at it?
(and does this cause any new failures?)
Yes, ext4 is broken. I've sent fixes for it yesterday. I'm not sure what
Argh, sorry I forgot that. I just want to be careful about more rigorous tests making it look like we have regressions in the code.
Quoted 6 lines
Quoted 2 lines
exactly would overflow at 2T ... block counts if signed int is used and blocksize is 1KB?
Hum ok, where'd I come up with 2T? :) never mind that maybe, unless there are other potential trouble points we should add (8T? 16T for filesystems that can handle it?)
Yeah, so 8T + something might be interesting and both ext4 & xfs should
handle that fine. 16T + something might be interesting for xfs if it supports that size. I'll update this patch with these checks.
Honza
Quoted 71 lines
Quoted 70 lines
Quoted 70 lines
Quoted 69 lines
Signed-off-by Jan Kara <[email protected]>--- src/seek_sanity_test.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+)src/seek_sanity_test.c +38
-0@@ -18,6 +18,7 @@*/ #define _XOPEN_SOURCE 500 +#define _FILE_OFFSET_BITS 64#include <sys/types.h> #include <sys/stat.h> #include <sys/vfs.h> @@ -191,6 +192,42 @@ static int do_lseek(int testnum, int subtest, int fd, int filsz, int origin,return ret; } +/* test a huge file to check for 4G overflows */ +static int test10 (int fd,int testnum) +{ +char *buf =NULL ; +int bufsz = alloc_size; +off_t filsz =8ULL <<30 ;/* 8G */ +off_t off = filsz -2 *bufsz; +int ret =-1 ; + + buf =do_malloc (bufsz); +if (!buf) + goto out; +memset (buf,'a' , bufsz); + + ret =do_pwrite (fd, buf, bufsz,0 ); +if (ret) + goto out; + ret =do_pwrite (fd, buf, bufsz, off); +if (ret) + goto out; + +/* offset at the beginning */ + ret +=do_lseek (testnum,1 , fd, filsz,SEEK_HOLE ,0 , bufsz); + ret +=do_lseek (testnum,2 , fd, filsz,SEEK_HOLE ,1 , bufsz); + ret +=do_lseek (testnum,3 , fd, filsz,SEEK_DATA ,0 ,0 ); + ret +=do_lseek (testnum,4 , fd, filsz,SEEK_DATA ,1 ,1 ); + +/* offset around eof */ + ret +=do_lseek (testnum,5 , fd, filsz,SEEK_HOLE , off, off + bufsz); + ret +=do_lseek (testnum,6 , fd, filsz,SEEK_DATA , off, off); + ret +=do_lseek (testnum,7 , fd, filsz,SEEK_DATA , off +1 , off +1 ); + +out: +do_free (buf); +return ret; +}/* * test file with unwritten extents, have both dirty and * writeback pages in page cache. @@ -577,6 +614,7 @@ struct testrec seek_tests[] = { { 7, test07, "Test file with unwritten extents, only have dirty pages" }, { 8, test08, "Test file with unwritten extents, only have unwritten pages" }, { 9, test09, "Test file with unwritten extents, have both dirty && unwritten pages" }, + { 10, test10, "Test a huge file" }, };static int run_test (struct testrec *tr)
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Quoted 15 lines · Jan Kara
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_DATAreturns and thus the test fails. Fix the problem by disabling the feature for this test.Signed-off-by Jan Kara <[email protected]>--- tests/generic/285 | 6 ++++++ 1 file changed, 6 insertions(+)tests/generic/285 +0
-0
tests/generic/285 BASE_TEST_FILE=$TEST_DIR/seek_sanity_testfile · line 53
Quoted 8 lines
tests/generic/285 +5
-0@@ -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.
Signature · 2 lines
Dave Chinner [email protected]
Re: [PATCH 3/3] 285: Test offsets over 4GB
In reply to Jan KaraQuoted 19 lines · Jan Kara
Quoted 18 lines · Eric Sandeen
Quoted 10 lines · Jan Kara
Quoted 8 lines · Eric Sandeen
Quoted 2 lines · Jan Kara
Test whether
SEEK_HOLEandSEEK_DATAworks correctly with offsets over 4GB.Hm, should we add 2T as well while we're at it?
(and does this cause any new failures?)
Yes, ext4 is broken. I've sent fixes for it yesterday. I'm not sure what
Argh, sorry I forgot that. I just want to be careful about more rigorous tests making it look like we have regressions in the code.
Quoted 2 lines
exactly would overflow at 2T ... block counts if signed int is used and blocksize is 1KB?
Quoted 6 lines
Quoted 3 lines
Hum ok, where'd I come up with 2T? :) never mind that maybe, unless there are other potential trouble points we should add (8T? 16T for filesystems that can handle it?)
Yeah, so 8T + something might be interesting and both ext4 & xfs should
handle that fine. 16T + something might be interesting for xfs if it supports that size. I'll update this patch with these checks.
What boundary traversal are we trying to test at these high offsets?
I mean, I can understand wanting to confirm they work, but there's no 32 bit variable boundary in the seek code at 8/16TB that needs to be specifically test is there? i.e. is it just testing the same case as the 8GB case?
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Quoted 19 lines · Dave Chinner
Quoted 18 lines · Jan Kara
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_DATAreturns and thus the test fails. Fix the problem by disabling the feature for this test.Signed-off-by Jan Kara <[email protected]>--- tests/generic/285 | 6 ++++++ 1 file changed, 6 insertions(+)tests/generic/285 +0
-0@@ -46,6 +46,12 @@ BASE_TEST_FILE=$TEST_DIR/seek_sanity_testfile [ -x $here/src/seek_sanity_test ] || _notrun "seek_sanitfy_tester not built"
Quoted 8 lines
tests/generic/285 BASE_TEST_FILE=$TEST_DIR/seek_sanity_testfile · line 53
Quoted 5 lines
tests/generic/285 +5
-0+# 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 +fiwould that be better going into
_require_seek_data_holeso 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
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Re: [PATCH 3/3] 285: Test offsets over 4GB
In reply to Dave ChinnerQuoted 23 lines · Dave Chinner
Quoted 22 lines · Jan Kara
Quoted 21 lines · Eric Sandeen
Quoted 10 lines · Jan Kara
Quoted 8 lines · Eric Sandeen
Quoted 2 lines · Jan Kara
Test whether
SEEK_HOLEandSEEK_DATAworks correctly with offsets over 4GB.Hm, should we add 2T as well while we're at it?
(and does this cause any new failures?)
Yes, ext4 is broken. I've sent fixes for it yesterday. I'm not sure what
Argh, sorry I forgot that. I just want to be careful about more rigorous tests making it look like we have regressions in the code.
Quoted 2 lines
exactly would overflow at 2T ... block counts if signed int is used and blocksize is 1KB?
Hum ok, where'd I come up with 2T? :) never mind that maybe, unless there are other potential trouble points we should add (8T? 16T for filesystems that can handle it?)
Quoted 6 lines
Quoted 3 lines
Yeah, so 8T + something might be interesting and both ext4 & xfs should
handle that fine. 16T + something might be interesting for xfs if it supports that size. I'll update this patch with these checks.What boundary traversal are we trying to test at these high offsets?
If fs converts passed offsets to block numbers (as ext4 does) and wrongly
used 32-bit signed instead of 32-bit unsigned type for block numbers, the overflow would happen at 8T. In case of XFS 64-bit counters should be used for blocks so checking somewhere beyond 16T is for that.
I'm testing at 3 different offsets because different filesystems have different s_maxbytes settings so we cannot just test beyond 16 TB - ext4 would just return EFBIG for that.
Honza
Signature · 7 lines
Jan Kara <[email protected]> SUSE Labs, CR _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs