diff mbox

btrfs/057: Fix test case to work on 64K page size

Message ID 1512542745-26243-1-git-send-email-harish@linux.vnet.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Harish Dec. 6, 2017, 6:45 a.m. UTC
On platforms with a page size greater than 4Kb, at the moment btrfs
doesn't support a node/leaf size smaller than the page size, but it
supports a larger one. So use the max supported node size (64Kb) so
that the test runs on any platform currently supported by Linux.

Signed-off-by: Harish <harish@linux.vnet.ibm.com>
---
 tests/btrfs/057     | 7 +++++--
 tests/btrfs/057.out | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)

Comments

Eryu Guan Dec. 6, 2017, 7:35 a.m. UTC | #1
On Wed, Dec 06, 2017 at 12:15:45PM +0530, Harish wrote:
> On platforms with a page size greater than 4Kb, at the moment btrfs
> doesn't support a node/leaf size smaller than the page size, but it
> supports a larger one. So use the max supported node size (64Kb) so
> that the test runs on any platform currently supported by Linux.
> 
> Signed-off-by: Harish <harish@linux.vnet.ibm.com>

Looks fine to me. Also cc btrfs list for review.

Thanks,
Eryu

> ---
>  tests/btrfs/057     | 7 +++++--
>  tests/btrfs/057.out | 4 ++--
>  2 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/btrfs/057 b/tests/btrfs/057
> index 8d35579..06b2be9 100755
> --- a/tests/btrfs/057
> +++ b/tests/btrfs/057
> @@ -48,8 +48,11 @@ _require_scratch
>  
>  rm -f $seqres.full
>  
> -# use small leaf size to get higher btree height.
> -run_check _scratch_mkfs "-b 1g --nodesize 4096"
> +# Currently in btrfs the node/leaf size can not be smaller than the page
> +# size (but it can be greater than the page size). So use the largest
> +# supported node/leaf size (64Kb) so that the test can run on any platform
> +# that Linux supports.
> +run_check _scratch_mkfs "-b 1g --nodesize 65536"
>  
>  # inode cache is saved in the FS tree itself for every
>  # individual FS tree,that affects the sizes reported by qgroup show
> diff --git a/tests/btrfs/057.out b/tests/btrfs/057.out
> index 60cb92d..f2d9e9c 100644
> --- a/tests/btrfs/057.out
> +++ b/tests/btrfs/057.out
> @@ -1,3 +1,3 @@
>  QA output created by 057
> -4096 4096
> -4096 4096
> +65536 65536
> +65536 65536
> -- 
> 2.7.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Qu Wenruo Dec. 6, 2017, 7:46 a.m. UTC | #2
On 2017年12月06日 15:35, Eryu Guan wrote:
> On Wed, Dec 06, 2017 at 12:15:45PM +0530, Harish wrote:
>> On platforms with a page size greater than 4Kb, at the moment btrfs
>> doesn't support a node/leaf size smaller than the page size, but it
>> supports a larger one. So use the max supported node size (64Kb) so
>> that the test runs on any platform currently supported by Linux.
>>
>> Signed-off-by: Harish <harish@linux.vnet.ibm.com>
> 
> Looks fine to me. Also cc btrfs list for review.
> 
> Thanks,
> Eryu
> 
>> ---
>>  tests/btrfs/057     | 7 +++++--
>>  tests/btrfs/057.out | 4 ++--
>>  2 files changed, 7 insertions(+), 4 deletions(-)
>>
>> diff --git a/tests/btrfs/057 b/tests/btrfs/057
>> index 8d35579..06b2be9 100755
>> --- a/tests/btrfs/057
>> +++ b/tests/btrfs/057
>> @@ -48,8 +48,11 @@ _require_scratch
>>  
>>  rm -f $seqres.full
>>  
>> -# use small leaf size to get higher btree height.
>> -run_check _scratch_mkfs "-b 1g --nodesize 4096"
>> +# Currently in btrfs the node/leaf size can not be smaller than the page
>> +# size (but it can be greater than the page size). So use the largest
>> +# supported node/leaf size (64Kb) so that the test can run on any platform
>> +# that Linux supports.
>> +run_check _scratch_mkfs "-b 1g --nodesize 65536"

Personally speaking, the test doesn't really need super high tree height.
So I think it's OK to use a different node size.

But I prefer default mkfs.btrfs, which will choose valid nodesize.
So for 4K system, it will use default 16K other than always using the
64K nodesize.


And further more, the test case is quite old, from the old days when we
did even have btrfs check support for qgroup.

With new btrfs check support, we don't really need to do anything to
check qgroup numbers in test cases, just let fstests post test routines
to handle it.

If qgroup is corrupted, fstests will report something inconsistent
filesystem at post test fsck.
Just like what we do in btrfs/126. (so no need to use any magic number
in 057.out)

So would you please also update the test case to get benefit from the
newer btrfs-progs?

Thanks,
Qu

>>  
>>  # inode cache is saved in the FS tree itself for every
>>  # individual FS tree,that affects the sizes reported by qgroup show
>> diff --git a/tests/btrfs/057.out b/tests/btrfs/057.out
>> index 60cb92d..f2d9e9c 100644
>> --- a/tests/btrfs/057.out
>> +++ b/tests/btrfs/057.out
>> @@ -1,3 +1,3 @@
>>  QA output created by 057
>> -4096 4096
>> -4096 4096
>> +65536 65536
>> +65536 65536
>> -- 
>> 2.7.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe fstests" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
Harish Dec. 7, 2017, 10:03 a.m. UTC | #3
Sure will work on this. Thanks.

Harish

On 12/06/2017 01:16 PM, Qu Wenruo wrote:
>
>
> On 2017年12月06日 15:35, Eryu Guan wrote:
>> On Wed, Dec 06, 2017 at 12:15:45PM +0530, Harish wrote:
>>> On platforms with a page size greater than 4Kb, at the moment btrfs
>>> doesn't support a node/leaf size smaller than the page size, but it
>>> supports a larger one. So use the max supported node size (64Kb) so
>>> that the test runs on any platform currently supported by Linux.
>>>
>>> Signed-off-by: Harish <harish@linux.vnet.ibm.com>
>>
>> Looks fine to me. Also cc btrfs list for review.
>>
>> Thanks,
>> Eryu
>>
>>> ---
>>>  tests/btrfs/057     | 7 +++++--
>>>  tests/btrfs/057.out | 4 ++--
>>>  2 files changed, 7 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/tests/btrfs/057 b/tests/btrfs/057
>>> index 8d35579..06b2be9 100755
>>> --- a/tests/btrfs/057
>>> +++ b/tests/btrfs/057
>>> @@ -48,8 +48,11 @@ _require_scratch
>>>
>>>  rm -f $seqres.full
>>>
>>> -# use small leaf size to get higher btree height.
>>> -run_check _scratch_mkfs "-b 1g --nodesize 4096"
>>> +# Currently in btrfs the node/leaf size can not be smaller than the page
>>> +# size (but it can be greater than the page size). So use the largest
>>> +# supported node/leaf size (64Kb) so that the test can run on any platform
>>> +# that Linux supports.
>>> +run_check _scratch_mkfs "-b 1g --nodesize 65536"
>
> Personally speaking, the test doesn't really need super high tree height.
> So I think it's OK to use a different node size.
>
> But I prefer default mkfs.btrfs, which will choose valid nodesize.
> So for 4K system, it will use default 16K other than always using the
> 64K nodesize.
>
>
> And further more, the test case is quite old, from the old days when we
> did even have btrfs check support for qgroup.
>
> With new btrfs check support, we don't really need to do anything to
> check qgroup numbers in test cases, just let fstests post test routines
> to handle it.
>
> If qgroup is corrupted, fstests will report something inconsistent
> filesystem at post test fsck.
> Just like what we do in btrfs/126. (so no need to use any magic number
> in 057.out)
>
> So would you please also update the test case to get benefit from the
> newer btrfs-progs?
>
> Thanks,
> Qu
>
>>>
>>>  # inode cache is saved in the FS tree itself for every
>>>  # individual FS tree,that affects the sizes reported by qgroup show
>>> diff --git a/tests/btrfs/057.out b/tests/btrfs/057.out
>>> index 60cb92d..f2d9e9c 100644
>>> --- a/tests/btrfs/057.out
>>> +++ b/tests/btrfs/057.out
>>> @@ -1,3 +1,3 @@
>>>  QA output created by 057
>>> -4096 4096
>>> -4096 4096
>>> +65536 65536
>>> +65536 65536
>>> --
>>> 2.7.4
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe fstests" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> --
>> To unsubscribe from this list: send the line "unsubscribe fstests" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>

--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/tests/btrfs/057 b/tests/btrfs/057
index 8d35579..06b2be9 100755
--- a/tests/btrfs/057
+++ b/tests/btrfs/057
@@ -48,8 +48,11 @@  _require_scratch
 
 rm -f $seqres.full
 
-# use small leaf size to get higher btree height.
-run_check _scratch_mkfs "-b 1g --nodesize 4096"
+# Currently in btrfs the node/leaf size can not be smaller than the page
+# size (but it can be greater than the page size). So use the largest
+# supported node/leaf size (64Kb) so that the test can run on any platform
+# that Linux supports.
+run_check _scratch_mkfs "-b 1g --nodesize 65536"
 
 # inode cache is saved in the FS tree itself for every
 # individual FS tree,that affects the sizes reported by qgroup show
diff --git a/tests/btrfs/057.out b/tests/btrfs/057.out
index 60cb92d..f2d9e9c 100644
--- a/tests/btrfs/057.out
+++ b/tests/btrfs/057.out
@@ -1,3 +1,3 @@ 
 QA output created by 057
-4096 4096
-4096 4096
+65536 65536
+65536 65536