diff mbox series

[3/5] btrfs-progs: mkfs-tests: Skip 010-minimal-size if we can't mount with 4k sector size

Message ID 20190705072651.25150-4-wqu@suse.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: tests: Make 64K page size system happier | expand

Commit Message

Qu Wenruo July 5, 2019, 7:26 a.m. UTC
[BUG]
Test case 010-minimal-size fails on aarch64 with 64K page size:
      [TEST/mkfs]   010-minimal-size
  failed: /home/adam/btrfs-progs/mkfs.btrfs -f -n 4k -m single -d single /home/adam/btrfs-progs/tests//test.img
  test failed for case 010-minimal-size
  make: *** [Makefile:361: test-mkfs] Error 1

[CAUSE]
Mkfs.btrfs defaults to page size as sector size. However this test uses
4k, 16k, 32K and 64K as node size. 4K node size will conflict with 64K
sector size.

[FIX]
- Specify sector size 4K manually
  So at least no conflict at mkfs time.

- Skip the test case if kernel can't mount with 4k sector size
  So once we add such support, the test can be automatically re-enabled.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 tests/mkfs-tests/010-minimal-size/test.sh | 41 ++++++++++++-----------
 1 file changed, 21 insertions(+), 20 deletions(-)

Comments

David Sterba July 22, 2019, 5:15 p.m. UTC | #1
On Fri, Jul 05, 2019 at 03:26:49PM +0800, Qu Wenruo wrote:
> [BUG]
> Test case 010-minimal-size fails on aarch64 with 64K page size:
>       [TEST/mkfs]   010-minimal-size
>   failed: /home/adam/btrfs-progs/mkfs.btrfs -f -n 4k -m single -d single /home/adam/btrfs-progs/tests//test.img
>   test failed for case 010-minimal-size
>   make: *** [Makefile:361: test-mkfs] Error 1
> 
> [CAUSE]
> Mkfs.btrfs defaults to page size as sector size. However this test uses
> 4k, 16k, 32K and 64K as node size. 4K node size will conflict with 64K
> sector size.
> 
> [FIX]
> - Specify sector size 4K manually
>   So at least no conflict at mkfs time.
> 
> - Skip the test case if kernel can't mount with 4k sector size
>   So once we add such support, the test can be automatically re-enabled.
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> ---
>  tests/mkfs-tests/010-minimal-size/test.sh | 41 ++++++++++++-----------
>  1 file changed, 21 insertions(+), 20 deletions(-)
> 
> diff --git a/tests/mkfs-tests/010-minimal-size/test.sh b/tests/mkfs-tests/010-minimal-size/test.sh
> index 8480e4c5ae23..b49fad63e519 100755
> --- a/tests/mkfs-tests/010-minimal-size/test.sh
> +++ b/tests/mkfs-tests/010-minimal-size/test.sh
> @@ -5,6 +5,7 @@ source "$TEST_TOP/common"
>  
>  check_prereq mkfs.btrfs
>  check_prereq btrfs
> +check_prereq_mount_with_sectorsize 4096

How about

	if `getconf PAGE_SIZE` != 4096; then
		_not_run "requires 4k pages"
	fi

and be done?

I don't like hardcoding the sectorsize, the effect should be the same
when the test is skipped at the beginning.

When we have the subpage-size functionality, there will be an incompat
bit exported through sysfs that we can check. Until then the cude
pagesize check should do. It is going to be a big change so we'll have
to revisit all tests anyway.
Qu Wenruo July 23, 2019, 1:08 a.m. UTC | #2
On 2019/7/23 上午1:15, David Sterba wrote:
> On Fri, Jul 05, 2019 at 03:26:49PM +0800, Qu Wenruo wrote:
>> [BUG]
>> Test case 010-minimal-size fails on aarch64 with 64K page size:
>>       [TEST/mkfs]   010-minimal-size
>>   failed: /home/adam/btrfs-progs/mkfs.btrfs -f -n 4k -m single -d single /home/adam/btrfs-progs/tests//test.img
>>   test failed for case 010-minimal-size
>>   make: *** [Makefile:361: test-mkfs] Error 1
>>
>> [CAUSE]
>> Mkfs.btrfs defaults to page size as sector size. However this test uses
>> 4k, 16k, 32K and 64K as node size. 4K node size will conflict with 64K
>> sector size.
>>
>> [FIX]
>> - Specify sector size 4K manually
>>   So at least no conflict at mkfs time.
>>
>> - Skip the test case if kernel can't mount with 4k sector size
>>   So once we add such support, the test can be automatically re-enabled.
>>
>> Signed-off-by: Qu Wenruo <wqu@suse.com>
>> ---
>>  tests/mkfs-tests/010-minimal-size/test.sh | 41 ++++++++++++-----------
>>  1 file changed, 21 insertions(+), 20 deletions(-)
>>
>> diff --git a/tests/mkfs-tests/010-minimal-size/test.sh b/tests/mkfs-tests/010-minimal-size/test.sh
>> index 8480e4c5ae23..b49fad63e519 100755
>> --- a/tests/mkfs-tests/010-minimal-size/test.sh
>> +++ b/tests/mkfs-tests/010-minimal-size/test.sh
>> @@ -5,6 +5,7 @@ source "$TEST_TOP/common"
>>  
>>  check_prereq mkfs.btrfs
>>  check_prereq btrfs
>> +check_prereq_mount_with_sectorsize 4096
> 
> How about
> 
> 	if `getconf PAGE_SIZE` != 4096; then
> 		_not_run "requires 4k pages"
> 	fi
> 
> and be done?

I'd like to make these tests future proof.

Maybe the subpage size support from IBM hasn't been updated for a long
time, but we should have such support eventually.

When that support is merged, with my current check no modification needs
to be done and every test can be run on 64k page size systems.

> 
> I don't like hardcoding the sectorsize, the effect should be the same
> when the test is skipped at the beginning.

So is the patch doing, just skipping the test on 64K system.
I didn't see any difference here except how we skip the tests.

> 
> When we have the subpage-size functionality, there will be an incompat
> bit exported through sysfs that we can check.

Why, there is no change in on-disk format, just a runtime feature.

> Until then the cude
> pagesize check should do. It is going to be a big change so we'll have
> to revisit all tests anyway.
>
diff mbox series

Patch

diff --git a/tests/mkfs-tests/010-minimal-size/test.sh b/tests/mkfs-tests/010-minimal-size/test.sh
index 8480e4c5ae23..b49fad63e519 100755
--- a/tests/mkfs-tests/010-minimal-size/test.sh
+++ b/tests/mkfs-tests/010-minimal-size/test.sh
@@ -5,6 +5,7 @@  source "$TEST_TOP/common"
 
 check_prereq mkfs.btrfs
 check_prereq btrfs
+check_prereq_mount_with_sectorsize 4096
 
 setup_root_helper
 
@@ -24,20 +25,20 @@  do_test()
 	run_check_umount_test_dev
 }
 
-do_test -n 4k	-m single	-d single
-do_test -n 4k	-m single	-d dup
-do_test -n 4k	-m dup		-d single
-do_test -n 4k	-m dup		-d dup
+do_test -s 4k	-n 4k	-m single	-d single
+do_test -s 4k	-n 4k	-m single	-d dup
+do_test -s 4k	-n 4k	-m dup		-d single
+do_test -s 4k	-n 4k	-m dup		-d dup
 
-do_test -n 8k	-m single	-d single
-do_test -n 8k	-m single	-d dup
-do_test -n 8k	-m dup		-d single
-do_test -n 8k	-m dup		-d dup
+do_test -s 4k	-n 8k	-m single	-d single
+do_test -s 4k	-n 8k	-m single	-d dup
+do_test -s 4k	-n 8k	-m dup		-d single
+do_test -s 4k	-n 8k	-m dup		-d dup
 
-do_test -n 16k	-m single	-d single
-do_test -n 16k	-m single	-d dup
-do_test -n 16k	-m dup		-d single
-do_test -n 16k	-m dup		-d dup
+do_test -s 4k	-n 16k	-m single	-d single
+do_test -s 4k	-n 16k	-m single	-d dup
+do_test -s 4k	-n 16k	-m dup		-d single
+do_test -s 4k	-n 16k	-m dup		-d dup
 
 # Temporary: disable the following tests as they fail inside travis but run
 # fine otherwise. This is probably caused by kernel version, 4.4 fails and 4.14
@@ -52,12 +53,12 @@  if [ "$TRAVIS" = true ]; then
 	exit 0
 fi
 
-do_test -n 32k	-m single	-d single
-do_test -n 32k	-m single	-d dup
-do_test -n 32k	-m dup		-d single
-do_test -n 32k	-m dup		-d dup
+do_test -s 4k	-n 32k	-m single	-d single
+do_test -s 4k	-n 32k	-m single	-d dup
+do_test -s 4k	-n 32k	-m dup		-d single
+do_test -s 4k	-n 32k	-m dup		-d dup
 
-do_test -n 64k	-m single	-d single
-do_test -n 64k	-m single	-d dup
-do_test -n 64k	-m dup		-d single
-do_test -n 64k	-m dup		-d dup
+do_test -s 4k	-n 64k	-m single	-d single
+do_test -s 4k	-n 64k	-m single	-d dup
+do_test -s 4k	-n 64k	-m dup		-d single
+do_test -s 4k	-n 64k	-m dup		-d dup