mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][2.5] Fix raid0 init failure
@ 2003-06-11  2:18 Zwane Mwaikambo
  2003-06-11  6:58 ` Neil Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Zwane Mwaikambo @ 2003-06-11  2:18 UTC (permalink / raw)
  To: Linux Kernel; +Cc: Neil Brown

create_strip_zone was accessing uninitialised data via 
zone->dev = conf->devlist 

Tested on a 2disk SCSI Raid0

BEFORE:
md0: setting max_sectors to 128, segment boundary to 32767
raid0: looking at sdf1
raid0:   comparing sdf1(4193152) with sdf1(4193152)
raid0:   END
raid0:   ==> UNIQUE
raid0: 1 zones
raid0: looking at sdc1
raid0:   comparing sdc1(4193152) with sdf1(4193152)
raid0:   EQUAL
raid0: FINAL 1 zones
raid0: multiple devices for 1 - aborting!
md: pers->run() failed ...
md :do_md_run() returned -22
md: md0 stopped.
md: unbind<sdf1>
md: export_rdev(sdf1)
md: unbind<sdc1>
md: export_rdev(sdc1)
md: ... autorun DONE.

AFTER:
md0: setting max_sectors to 128, segment boundary to 32767
raid0: looking at sdf1
raid0:   comparing sdf1(4193152) with sdf1(4193152)
raid0:   END
raid0:   ==> UNIQUE
raid0: 1 zones
raid0: looking at sdc1
raid0:   comparing sdc1(4193152) with sdf1(4193152)
raid0:   EQUAL
raid0: FINAL 1 zones
raid0: done.
raid0 : md_size is 8386304 blocks.
raid0 : conf->hash_spacing is 8386304 blocks.
raid0 : nb_zone is 1.
raid0 : Allocating 4 bytes for hash.
md: ... autorun DONE.

Index: linux-2.5/drivers/md/raid0.c
===================================================================
RCS file: /home/cvs/linux-2.5/drivers/md/raid0.c,v
retrieving revision 1.32
diff -u -p -B -r1.32 raid0.c
--- linux-2.5/drivers/md/raid0.c	5 Jun 2003 06:30:06 -0000	1.32
+++ linux-2.5/drivers/md/raid0.c	11 Jun 2003 00:51:30 -0000
@@ -90,6 +90,10 @@ static int create_strip_zones (mddev_t *
 
 	memset(conf->strip_zone, 0,sizeof(struct strip_zone)*
 				   conf->nr_strip_zones);
+
+	memset(conf->devlist, 0, sizeof (mdk_rdev_t*)*
+		conf->nr_strip_zones*mddev->raid_disks);
+
 	/* The first zone must contain all devices, so here we check that
 	 * there is a proper alignment of slots to devices and find them all
 	 */
-- 
function.linuxpower.ca

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

* Re: [PATCH][2.5] Fix raid0 init failure
  2003-06-11  2:18 [PATCH][2.5] Fix raid0 init failure Zwane Mwaikambo
@ 2003-06-11  6:58 ` Neil Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Neil Brown @ 2003-06-11  6:58 UTC (permalink / raw)
  To: Zwane Mwaikambo; +Cc: Linux Kernel

On Tuesday June 10, zwane@linuxpower.ca wrote:
> create_strip_zone was accessing uninitialised data via 
> zone->dev = conf->devlist 

Yes thank.  There are few more of those in other raid levels.  I'm
about to send a patch off to Linus.

NeilBrown

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

end of thread, other threads:[~2003-06-11  4:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-11  2:18 [PATCH][2.5] Fix raid0 init failure Zwane Mwaikambo
2003-06-11  6:58 ` Neil Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®