xfstests: btrfs/004: fix to make test really work
diff mbox

Message ID 1392034256-2412-1-git-send-email-wangshilong1991@gmail.com
State Not Applicable
Headers show

Commit Message

Wang Shilong Feb. 10, 2014, 12:10 p.m. UTC
From: Wang Shilong <wangsl.fnst@cn.fujitsu.com>

So i was wandering why test 004 could pass my previous wrong
kernel patch while it defenitely should not.

By some debugging, i found here perl script is wrong, we did not
filter out anything and this unit test did not work acutally.so
it came out we will never fail this test.

Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
---
 tests/btrfs/004 | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
 mode change 100755 => 100644 tests/btrfs/004

Comments

Josef Bacik Feb. 10, 2014, 7:18 p.m. UTC | #1
On 02/10/2014 07:10 AM, Wang Shilong wrote:
> From: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
>
> So i was wandering why test 004 could pass my previous wrong
> kernel patch while it defenitely should not.
>
> By some debugging, i found here perl script is wrong, we did not
> filter out anything and this unit test did not work acutally.so
> it came out we will never fail this test.
>

So now with this patch I'm failing it, is there some btrfs patch I need 
to make it not fail or is it still not supposed to fail normally and is 
this patch broken?  Thanks,

Josef
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dave Chinner Feb. 10, 2014, 9:39 p.m. UTC | #2
On Mon, Feb 10, 2014 at 08:10:56PM +0800, Wang Shilong wrote:
> From: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
> 
> So i was wandering why test 004 could pass my previous wrong
> kernel patch while it defenitely should not.
> 
> By some debugging, i found here perl script is wrong, we did not
> filter out anything and this unit test did not work acutally.so
> it came out we will never fail this test.
> 
> Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
> ---
>  tests/btrfs/004 | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>  mode change 100755 => 100644 tests/btrfs/004
> 
> diff --git a/tests/btrfs/004 b/tests/btrfs/004
> old mode 100755
> new mode 100644
> index 14da9f1..17a6e34
> --- a/tests/btrfs/004
> +++ b/tests/btrfs/004
> @@ -57,10 +57,9 @@ _require_command "/usr/sbin/filefrag"
>  
>  rm -f $seqres.full
>  
> -FILEFRAG_FILTER='if (/, blocksize (\d+)/) {$blocksize = $1; next} ($ext, '\
> -'$logical, $physical, $expected, $length, $flags) = (/^\s*(\d+)\s+(\d+)'\
> -'\s+(\d+)\s+(?:(\d+)\s+)?(\d+)\s+(.*)/) or next; $flags =~ '\
> -'/(?:^|,)inline(?:,|$)/ and next; print $physical * $blocksize, "#", '\
> +FILEFRAG_FILTER='if (/blocks of (\d+) bytes/) {$blocksize = $1; next} ($ext, '\
> +'$logical, $physical, $length) = (/^\s*(\d+):\s+(\d+)..\s+\d+:'\
> +'\s+(\d+)..\s+\d+:\s+(\d+):/) or next; print $physical * $blocksize, "#", '\
>  '$length * $blocksize, "#", $logical * $blocksize, " "'

Oh, boy, who allowed that mess to pass review? Please format this in
a readable manner while you are changing it.

FILEFRAG_FILTER='
	if (/blocks of (\d+) bytes/) {			\
		$blocksize = $1;			\
		next;					\
	}
.....

Cheers,

Dave.
Wang Shilong Feb. 11, 2014, 1:22 a.m. UTC | #3
Hi Josef,

On 02/11/2014 03:18 AM, Josef Bacik wrote:
>
>
> On 02/10/2014 07:10 AM, Wang Shilong wrote:
>> From: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
>>
>> So i was wandering why test 004 could pass my previous wrong
>> kernel patch while it defenitely should not.
>>
>> By some debugging, i found here perl script is wrong, we did not
>> filter out anything and this unit test did not work acutally.so
>> it came out we will never fail this test.
>>
>
> So now with this patch I'm failing it, is there some btrfs patch I 
> need to make it not fail or is it still not supposed to fail normally 
> and is this patch broken?  Thanks,
You should not have updated my previous patch(Btrfs: switch to 
btrfs_previous_extent_item()) when you fail this test.
I update your latest btrfs-next which has updated my previous patch and 
it can pass this case, did you miss that?

Thanks,
Wang
>
> Josef
> -- 
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" 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 linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Wang Shilong Feb. 11, 2014, 1:24 a.m. UTC | #4
On 02/11/2014 05:39 AM, Dave Chinner wrote:
> On Mon, Feb 10, 2014 at 08:10:56PM +0800, Wang Shilong wrote:
>> From: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
>>
>> So i was wandering why test 004 could pass my previous wrong
>> kernel patch while it defenitely should not.
>>
>> By some debugging, i found here perl script is wrong, we did not
>> filter out anything and this unit test did not work acutally.so
>> it came out we will never fail this test.
>>
>> Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
>> ---
>>   tests/btrfs/004 | 7 +++----
>>   1 file changed, 3 insertions(+), 4 deletions(-)
>>   mode change 100755 => 100644 tests/btrfs/004
>>
>> diff --git a/tests/btrfs/004 b/tests/btrfs/004
>> old mode 100755
>> new mode 100644
>> index 14da9f1..17a6e34
>> --- a/tests/btrfs/004
>> +++ b/tests/btrfs/004
>> @@ -57,10 +57,9 @@ _require_command "/usr/sbin/filefrag"
>>   
>>   rm -f $seqres.full
>>   
>> -FILEFRAG_FILTER='if (/, blocksize (\d+)/) {$blocksize = $1; next} ($ext, '\
>> -'$logical, $physical, $expected, $length, $flags) = (/^\s*(\d+)\s+(\d+)'\
>> -'\s+(\d+)\s+(?:(\d+)\s+)?(\d+)\s+(.*)/) or next; $flags =~ '\
>> -'/(?:^|,)inline(?:,|$)/ and next; print $physical * $blocksize, "#", '\
>> +FILEFRAG_FILTER='if (/blocks of (\d+) bytes/) {$blocksize = $1; next} ($ext, '\
>> +'$logical, $physical, $length) = (/^\s*(\d+):\s+(\d+)..\s+\d+:'\
>> +'\s+(\d+)..\s+\d+:\s+(\d+):/) or next; print $physical * $blocksize, "#", '\
>>   '$length * $blocksize, "#", $logical * $blocksize, " "'
> Oh, boy, who allowed that mess to pass review? Please format this in
> a readable manner while you are changing it.
Yeah,  i was thinking to make it more readable while i had sent this out.^_^
Thanks for your comments.

Wang
>
> FILEFRAG_FILTER='
> 	if (/blocks of (\d+) bytes/) {			\
> 		$blocksize = $1;			\
> 		next;					\
> 	}
> .....
>
> Cheers,
>
> Dave.

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Josef Bacik Feb. 11, 2014, 2:01 a.m. UTC | #5
On 02/10/2014 08:22 PM, Wang Shilong wrote:
> Hi Josef,
>
> On 02/11/2014 03:18 AM, Josef Bacik wrote:
>>
>>
>> On 02/10/2014 07:10 AM, Wang Shilong wrote:
>>> From: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
>>>
>>> So i was wandering why test 004 could pass my previous wrong
>>> kernel patch while it defenitely should not.
>>>
>>> By some debugging, i found here perl script is wrong, we did not
>>> filter out anything and this unit test did not work acutally.so
>>> it came out we will never fail this test.
>>>
>>
>> So now with this patch I'm failing it, is there some btrfs patch I 
>> need to make it not fail or is it still not supposed to fail normally 
>> and is this patch broken?  Thanks,
> You should not have updated my previous patch(Btrfs: switch to 
> btrfs_previous_extent_item()) when you fail this test.
> I update your latest btrfs-next which has updated my previous patch 
> and it can pass this case, did you miss that?

Hrm I must not have insmod'ed the new module, which now means I have to 
re-run all my tests, sigh.

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

Patch
diff mbox

diff --git a/tests/btrfs/004 b/tests/btrfs/004
old mode 100755
new mode 100644
index 14da9f1..17a6e34
--- a/tests/btrfs/004
+++ b/tests/btrfs/004
@@ -57,10 +57,9 @@  _require_command "/usr/sbin/filefrag"
 
 rm -f $seqres.full
 
-FILEFRAG_FILTER='if (/, blocksize (\d+)/) {$blocksize = $1; next} ($ext, '\
-'$logical, $physical, $expected, $length, $flags) = (/^\s*(\d+)\s+(\d+)'\
-'\s+(\d+)\s+(?:(\d+)\s+)?(\d+)\s+(.*)/) or next; $flags =~ '\
-'/(?:^|,)inline(?:,|$)/ and next; print $physical * $blocksize, "#", '\
+FILEFRAG_FILTER='if (/blocks of (\d+) bytes/) {$blocksize = $1; next} ($ext, '\
+'$logical, $physical, $length) = (/^\s*(\d+):\s+(\d+)..\s+\d+:'\
+'\s+(\d+)..\s+\d+:\s+(\d+):/) or next; print $physical * $blocksize, "#", '\
 '$length * $blocksize, "#", $logical * $blocksize, " "'
 
 # this makes filefrag output script readable by using a perl helper.