lkml.org 
[lkml]   [2009]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/6] Handle possible bio_alloc failure in btrfs
Date
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;



\
 
 \ /
  Last update: 2009-04-14 13:13    [W:0.023 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site