linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* md:Fix a bug in function badblocks_show().
@ 2012-03-08  6:46 majianpeng
  2012-03-14  1:32 ` NeilBrown
  0 siblings, 1 reply; 4+ messages in thread
From: majianpeng @ 2012-03-08  6:46 UTC (permalink / raw)
  To: Neil Brown; +Cc: linux-raid

From 58d2ba381eee4b732fca99a7311b1dcf589f57c3 Mon Sep 17 00:00:00 2001
From: majianpeng <majianpeng@gmail.com>
Date: Thu, 8 Mar 2012 14:37:00 +0800
Subject: [PATCH] md:Fix a bug in function badblocks_show().

If unack==0, it will show all bad blocks include unacknowledged-bad-blocks.

Signed-off-by: majianpeng <majianpeng@gmail.com>
---
 drivers/md/md.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index ce88755..3f1b6e5 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -8091,7 +8091,7 @@ retry:
 		int ack = BB_ACK(p[i]);
 		i++;
 
-		if (unack && ack)
+		if ((unack ^ ack) == 0)
 			continue;
 
 		len += snprintf(page+len, PAGE_SIZE-len, "%llu %u\n",
-- 
1.7.5.4

 				
--------------
majianpeng
2012-03-08


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: md:Fix a bug in function badblocks_show().
  2012-03-08  6:46 md:Fix a bug in function badblocks_show() majianpeng
@ 2012-03-14  1:32 ` NeilBrown
  2012-06-12  9:04   ` kedacomkernel
  0 siblings, 1 reply; 4+ messages in thread
From: NeilBrown @ 2012-03-14  1:32 UTC (permalink / raw)
  To: majianpeng; +Cc: linux-raid

[-- Attachment #1: Type: text/plain, Size: 1057 bytes --]

On Thu, 8 Mar 2012 14:46:52 +0800 "majianpeng" <majianpeng@gmail.com> wrote:

> >From 58d2ba381eee4b732fca99a7311b1dcf589f57c3 Mon Sep 17 00:00:00 2001
> From: majianpeng <majianpeng@gmail.com>
> Date: Thu, 8 Mar 2012 14:37:00 +0800
> Subject: [PATCH] md:Fix a bug in function badblocks_show().
> 
> If unack==0, it will show all bad blocks include unacknowledged-bad-blocks.

Correct.  It is meant to.
The "bad_blocks" file shows all bad blocks.
The "unacknowledged_bad_blocks" file show all unacknowledged bad blocks.

Thanks,
NeilBrown


> 
> Signed-off-by: majianpeng <majianpeng@gmail.com>
> ---
>  drivers/md/md.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index ce88755..3f1b6e5 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -8091,7 +8091,7 @@ retry:
>  		int ack = BB_ACK(p[i]);
>  		i++;
>  
> -		if (unack && ack)
> +		if ((unack ^ ack) == 0)
>  			continue;
>  
>  		len += snprintf(page+len, PAGE_SIZE-len, "%llu %u\n",


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Re: md:Fix a bug in function badblocks_show().
  2012-03-14  1:32 ` NeilBrown
@ 2012-06-12  9:04   ` kedacomkernel
  2012-06-27  3:01     ` NeilBrown
  0 siblings, 1 reply; 4+ messages in thread
From: kedacomkernel @ 2012-06-12  9:04 UTC (permalink / raw)
  To: Neil Brown, majianpeng; +Cc: linux-raid

On 2012-03-14 09:32 NeilBrown <neilb@suse.de> Wrote:
>On Thu, 8 Mar 2012 14:46:52 +0800 "majianpeng" <majianpeng@gmail.com> wrote:
>
>> >From 58d2ba381eee4b732fca99a7311b1dcf589f57c3 Mon Sep 17 00:00:00 2001
>> From: majianpeng <majianpeng@gmail.com>
>> Date: Thu, 8 Mar 2012 14:37:00 +0800
>> Subject: [PATCH] md:Fix a bug in function badblocks_show().
>> 
>> If unack==0, it will show all bad blocks include unacknowledged-bad-blocks.
>
>Correct.  It is meant to.
>The "bad_blocks" file shows all bad blocks.
>The "unacknowledged_bad_blocks" file show all unacknowledged bad blocks.
>
>Thanks,
>NeilBrown
>
>
>> 
>> Signed-off-by: majianpeng <majianpeng@gmail.com>
>> ---
>>  drivers/md/md.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>> 
>> diff --git a/drivers/md/md.c b/drivers/md/md.c
>> index ce88755..3f1b6e5 100644
>> --- a/drivers/md/md.c
>> +++ b/drivers/md/md.c
>> @@ -8091,7 +8091,7 @@ retry:
>>  		int ack = BB_ACK(p[i]);
>>  		i++;
>>  
>> -		if (unack && ack)
>> +		if ((unack ^ ack) == 0)
>>  			continue;
>>  
>>  		len += snprintf(page+len, PAGE_SIZE-len, "%llu %u\n",
>
>
Hi Neil:
	I found this bug in kernel-3.5-rc2.I deem you may lost to apply this patch.

Thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: md:Fix a bug in function badblocks_show().
  2012-06-12  9:04   ` kedacomkernel
@ 2012-06-27  3:01     ` NeilBrown
  0 siblings, 0 replies; 4+ messages in thread
From: NeilBrown @ 2012-06-27  3:01 UTC (permalink / raw)
  To: kedacomkernel; +Cc: majianpeng, linux-raid

[-- Attachment #1: Type: text/plain, Size: 1577 bytes --]

On Tue, 12 Jun 2012 17:04:00 +0800 kedacomkernel <kedacomkernel@gmail.com>
wrote:

> On 2012-03-14 09:32 NeilBrown <neilb@suse.de> Wrote:
> >On Thu, 8 Mar 2012 14:46:52 +0800 "majianpeng" <majianpeng@gmail.com> wrote:
> >
> >> >From 58d2ba381eee4b732fca99a7311b1dcf589f57c3 Mon Sep 17 00:00:00 2001
> >> From: majianpeng <majianpeng@gmail.com>
> >> Date: Thu, 8 Mar 2012 14:37:00 +0800
> >> Subject: [PATCH] md:Fix a bug in function badblocks_show().
> >> 
> >> If unack==0, it will show all bad blocks include unacknowledged-bad-blocks.
> >
> >Correct.  It is meant to.
> >The "bad_blocks" file shows all bad blocks.
> >The "unacknowledged_bad_blocks" file show all unacknowledged bad blocks.
> >
> >Thanks,
> >NeilBrown
> >
> >
> >> 
> >> Signed-off-by: majianpeng <majianpeng@gmail.com>
> >> ---
> >>  drivers/md/md.c |    2 +-
> >>  1 files changed, 1 insertions(+), 1 deletions(-)
> >> 
> >> diff --git a/drivers/md/md.c b/drivers/md/md.c
> >> index ce88755..3f1b6e5 100644
> >> --- a/drivers/md/md.c
> >> +++ b/drivers/md/md.c
> >> @@ -8091,7 +8091,7 @@ retry:
> >>  		int ack = BB_ACK(p[i]);
> >>  		i++;
> >>  
> >> -		if (unack && ack)
> >> +		if ((unack ^ ack) == 0)
> >>  			continue;
> >>  
> >>  		len += snprintf(page+len, PAGE_SIZE-len, "%llu %u\n",
> >
> >
> Hi Neil:
> 	I found this bug in kernel-3.5-rc2.I deem you may lost to apply this patch.

No, I didn't lose it.  I deliberately chose not to apply it.
As I said, the current behaviour is correct.  Please read the message that you
replied to.

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-06-27  3:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-08  6:46 md:Fix a bug in function badblocks_show() majianpeng
2012-03-14  1:32 ` NeilBrown
2012-06-12  9:04   ` kedacomkernel
2012-06-27  3:01     ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).