All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] Handle possible bio_alloc failure in md
@ 2009-04-14 11:06 Nikanth Karthikesan
  0 siblings, 0 replies; only message in thread
From: Nikanth Karthikesan @ 2009-04-14 11:06 UTC (permalink / raw)
  To: Neil Brown; +Cc: Jens Axboe, linux-kernel, linux-raid

Handle possible bio_alloc failure in md.

Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>

---


Index: linux-2.6/drivers/md/md.c
===================================================================
--- linux-2.6.orig/drivers/md/md.c
+++ linux-2.6/drivers/md/md.c
@@ -532,6 +532,9 @@ void md_super_write(mddev_t *mddev, mdk_
 	struct bio *bio = bio_alloc(GFP_NOIO, 1);
 	int rw = (1<<BIO_RW) | (1<<BIO_RW_SYNCIO) | (1<<BIO_RW_UNPLUG);
 
+	if (unlikely(!bio))
+		md_error(rdev->mddev, rdev);
+
 	bio->bi_bdev = rdev->bdev;
 	bio->bi_sector = sector;
 	bio_add_page(bio, page, size, 0);
@@ -587,6 +590,9 @@ int sync_page_io(struct block_device *bd
 	struct completion event;
 	int ret;
 
+	if (unlikely(!bio))
+		return 0;
+
 	rw |= (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG);
 
 	bio->bi_bdev = bdev;



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

only message in thread, other threads:[~2009-04-14 11:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-14 11:06 [PATCH 1/6] Handle possible bio_alloc failure in md Nikanth Karthikesan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.