public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/6] Handle possible bio_alloc failure in submit_bh
@ 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: Jens Axboe; +Cc: linux-kernel, Andrew Morton

Handle possible bio_alloc failure in submit_bh.

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

---

Index: linux-2.6/fs/buffer.c
===================================================================
--- linux-2.6.orig/fs/buffer.c
+++ linux-2.6/fs/buffer.c
@@ -2922,6 +2922,8 @@ int submit_bh(int rw, struct buffer_head
 	 * submit_bio -> generic_make_request may further map this bio around
 	 */
 	bio = bio_alloc(GFP_NOIO, 1);
+	if (unlikely(!bio))
+		panic("Failed to allocate bio\n");
 
 	bio->bi_sector = bh->b_blocknr * (bh->b_size >> 9);
 	bio->bi_bdev = bh->b_bdev;



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

only message in thread, other threads:[~2009-04-14 11:11 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 3/6] Handle possible bio_alloc failure in submit_bh Nikanth Karthikesan

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