From: Nikanth Karthikesan <knikanth@suse.de>
To: Chris Mason <chris.mason@oracle.com>
Cc: Jens Axboe <jens.axboe@oracle.com>,
linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: [PATCH 2/6] Handle possible bio_alloc failure in btrfs
Date: Tue, 14 Apr 2009 16:36:36 +0530 [thread overview]
Message-ID: <200904141636.36894.knikanth@suse.de> (raw)
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;
reply other threads:[~2009-04-14 11:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200904141636.36894.knikanth@suse.de \
--to=knikanth@suse.de \
--cc=chris.mason@oracle.com \
--cc=jens.axboe@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox