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

Handle possible bio_alloc failure in btrfs.

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

---

Index: linux-2.6/fs/btrfs/inode.c
===================================================================
--- linux-2.6.orig/fs/btrfs/inode.c
+++ linux-2.6/fs/btrfs/inode.c
@@ -1714,6 +1714,11 @@ static int btrfs_io_failed_hook(struct b
 		return -EIO;
 	}
 	bio = bio_alloc(GFP_NOFS, 1);
+	if (unlikely(!bio)) {
+		kfree(failrec);
+		return -ENOMEM;
+	}
+	
 	bio->bi_private = state;
 	bio->bi_end_io = failed_bio->bi_end_io;
 	bio->bi_sector = failrec->logical >> 9;



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

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

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