linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] md: Fix for raid6 reshape.
       [not found] <20070302155626.19014.patches@notabene>
@ 2007-03-02  4:56 ` NeilBrown
  2007-03-02  6:36   ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: NeilBrown @ 2007-03-02  4:56 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-raid, linux-kernel

### Comments for Changeset

Recent patch for raid6 reshape had a change missing that showed up in
subsequent review.

Many places in the raid5 code used "conf->raid_disks-1" to mean
"number of data disks".  With raid6 that had to be changed to
"conf->raid_disk - conf->max_degraded" or similar.  One place was missed.

This bug means that if a raid6 reshape were aborted in the middle the
recorded position would be wrong.  On restart it would either fail (as
the position wasn't on an appropriate boundary) or would leave a section
of the array unreshaped, causing data corruption.


Signed-off-by: Neil Brown <neilb@suse.de>

### Diffstat output
 ./drivers/md/raid5.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff .prev/drivers/md/raid5.c ./drivers/md/raid5.c
--- .prev/drivers/md/raid5.c	2007-03-02 15:47:51.000000000 +1100
+++ ./drivers/md/raid5.c	2007-03-02 15:48:35.000000000 +1100
@@ -3071,7 +3071,7 @@ static sector_t reshape_request(mddev_t 
 		release_stripe(sh);
 	}
 	spin_lock_irq(&conf->device_lock);
-	conf->expand_progress = (sector_nr + i)*(conf->raid_disks-1);
+	conf->expand_progress = (sector_nr + i) * new_data_disks);
 	spin_unlock_irq(&conf->device_lock);
 	/* Ok, those stripe are ready. We can start scheduling
 	 * reads on the source stripes.

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

* Re: [PATCH] md: Fix for raid6 reshape.
  2007-03-02  4:56 ` [PATCH] md: Fix for raid6 reshape NeilBrown
@ 2007-03-02  6:36   ` Andrew Morton
  2007-03-02  6:40     ` Neil Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2007-03-02  6:36 UTC (permalink / raw)
  To: NeilBrown; +Cc: linux-raid, linux-kernel

On Fri, 2 Mar 2007 15:56:55 +1100 NeilBrown <neilb@suse.de> wrote:

> -	conf->expand_progress = (sector_nr + i)*(conf->raid_disks-1);
> +	conf->expand_progress = (sector_nr + i) * new_data_disks);

ahem.

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

* Re: [PATCH] md: Fix for raid6 reshape.
  2007-03-02  6:36   ` Andrew Morton
@ 2007-03-02  6:40     ` Neil Brown
  2007-03-02 20:34       ` Bill Davidsen
  0 siblings, 1 reply; 5+ messages in thread
From: Neil Brown @ 2007-03-02  6:40 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-raid, linux-kernel

On Thursday March 1, akpm@linux-foundation.org wrote:
> On Fri, 2 Mar 2007 15:56:55 +1100 NeilBrown <neilb@suse.de> wrote:
> 
> > -	conf->expand_progress = (sector_nr + i)*(conf->raid_disks-1);
> > +	conf->expand_progress = (sector_nr + i) * new_data_disks);
> 
> ahem.


It wasn't like that when I tested it, honest...
But the original got caught up with some other changes which were not
really related so I removed them all and just made this change
manually.... and totally messed it up (again).  Sorry.

Of course it should be

> > +	conf->expand_progress = (sector_nr + i) * new_data_disks;

NeilBrown

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

* Re: [PATCH] md: Fix for raid6 reshape.
  2007-03-02  6:40     ` Neil Brown
@ 2007-03-02 20:34       ` Bill Davidsen
  2007-03-06  0:01         ` Neil Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Bill Davidsen @ 2007-03-02 20:34 UTC (permalink / raw)
  To: Neil Brown; +Cc: Andrew Morton, linux-raid, linux-kernel

Neil Brown wrote:
> On Thursday March 1, akpm@linux-foundation.org wrote:
>   
>> On Fri, 2 Mar 2007 15:56:55 +1100 NeilBrown <neilb@suse.de> wrote:
>>
>>     
>>> -	conf->expand_progress = (sector_nr + i)*(conf->raid_disks-1);
>>> +	conf->expand_progress = (sector_nr + i) * new_data_disks);
>>>       
>> ahem.
>>     
>
>
> It wasn't like that when I tested it, honest...
> But the original got caught up with some other changes which were not
> really related so I removed them all and just made this change
> manually.... and totally messed it up (again).  Sorry.
>
> Of course it should be
>
>   
>>> +	conf->expand_progress = (sector_nr + i) * new_data_disks;
>>>       
Will the (real) fix be in 2.6.21?

-- 
bill davidsen <davidsen@tmr.com>
  CTO TMR Associates, Inc
  Doing interesting things with small computers since 1979


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

* Re: [PATCH] md: Fix for raid6 reshape.
  2007-03-02 20:34       ` Bill Davidsen
@ 2007-03-06  0:01         ` Neil Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Neil Brown @ 2007-03-06  0:01 UTC (permalink / raw)
  To: Bill Davidsen; +Cc: linux-raid, linux-kernel

On Friday March 2, davidsen@tmr.com wrote:
> >   
> >>> +	conf->expand_progress = (sector_nr + i) * new_data_disks;
> >>>       
> Will the (real) fix be in 2.6.21?

It is now in Linus' git tree, so yes.

NeilBrown

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

end of thread, other threads:[~2007-03-06  0:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20070302155626.19014.patches@notabene>
2007-03-02  4:56 ` [PATCH] md: Fix for raid6 reshape NeilBrown
2007-03-02  6:36   ` Andrew Morton
2007-03-02  6:40     ` Neil Brown
2007-03-02 20:34       ` Bill Davidsen
2007-03-06  0:01         ` Neil Brown

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).