linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Subject:[PATCH 002:013]: raid0: find_zone to return NULL
@ 2009-06-16 21:52 raz ben yehuda
  0 siblings, 0 replies; only message in thread
From: raz ben yehuda @ 2009-06-16 21:52 UTC (permalink / raw)
  To: linux raid, Neil Brown

Have the caller decide whether to report BUG() 
	when zone is incorrect

 raid0.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Signed-off-by: razb <raziebe@gmail.com>
---
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index 851e631..8870acc 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -377,7 +377,7 @@ static struct strip_zone *find_zone(struct raid0_private_data *conf,
 				*sectorp = sector - z[i-1].zone_end;
 			return z + i;
 		}
-	BUG();
+	return NULL;
 }
 
 /*
@@ -481,6 +481,8 @@ static int raid0_make_request(struct request_queue *q, struct bio *bio)
 
 	sector_offset = bio->bi_sector;
 	zone =  find_zone(mddev->private, &sector_offset);
+	if (!zone)
+		BUG();
 	tmp_dev = map_sector(mddev, zone, bio->bi_sector,
 			     &sector_offset);
 	bio->bi_bdev = tmp_dev->bdev;






^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-06-16 21:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-16 21:52 Subject:[PATCH 002:013]: raid0: find_zone to return NULL raz ben yehuda

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