public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5/6] Handle possible bio_alloc failure in xfs
@ 2009-04-14 11:06 Nikanth Karthikesan
  2009-04-14 16:23 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Nikanth Karthikesan @ 2009-04-14 11:06 UTC (permalink / raw)
  To: xfs-masters; +Cc: Jens Axboe, linux-kernel, xfs

Handle bio_alloc failure in xfs.

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

---

Index: linux-2.6/fs/xfs/linux-2.6/xfs_buf.c
===================================================================
--- linux-2.6.orig/fs/xfs/linux-2.6/xfs_buf.c
+++ linux-2.6/fs/xfs/linux-2.6/xfs_buf.c
@@ -1196,6 +1196,8 @@ _xfs_buf_ioapply(
 	      (XBF_READ|_XBF_PAGE_LOCKED)) &&
 	    (blocksize >= PAGE_CACHE_SIZE)) {
 		bio = bio_alloc(GFP_NOIO, 1);
+		if (unlikely(!bio))
+			goto out_enomem;
 
 		bio->bi_bdev = bp->b_target->bt_bdev;
 		bio->bi_sector = sector - (offset >> BBSHIFT);
@@ -1217,6 +1219,9 @@ next_chunk:
 		nr_pages = total_nr_pages;
 
 	bio = bio_alloc(GFP_NOIO, nr_pages);
+	if (unlikely(!bio))
+		goto out_enomem;
+
 	bio->bi_bdev = bp->b_target->bt_bdev;
 	bio->bi_sector = sector;
 	bio->bi_end_io = xfs_buf_bio_end_io;
@@ -1247,6 +1252,11 @@ submit_io:
 		bio_put(bio);
 		xfs_buf_ioerror(bp, EIO);
 	}
+	return;
+
+out_enomem:
+	xfs_buf_ioerror(bp, ENOMEM);
+	
 }
 
 int



_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 5/6] Handle possible bio_alloc failure in xfs
  2009-04-14 11:06 [PATCH 5/6] Handle possible bio_alloc failure in xfs Nikanth Karthikesan
@ 2009-04-14 16:23 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2009-04-14 16:23 UTC (permalink / raw)
  To: Nikanth Karthikesan; +Cc: xfs-masters, xfs, linux-kernel, Jens Axboe

On Tue, Apr 14, 2009 at 04:36:45PM +0530, Nikanth Karthikesan wrote:
> Handle bio_alloc failure in xfs.
> 
> Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>

NAK, as already explained by Jens.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-14 16:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-14 11:06 [PATCH 5/6] Handle possible bio_alloc failure in xfs Nikanth Karthikesan
2009-04-14 16:23 ` Christoph Hellwig

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