Handle possible bio_alloc failure in xfs
PATCH 5/6 Handle possible bio_alloc failure in xfs
Handle bio_alloc failure in xfs.
Signed-off-by Nikanth Karthikesan <[email protected]>
---
fs/xfs/linux-2.6/xfs_buf.c +10 -0
@@ -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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 3 lines · Nikanth Karthikesan
Handle
bio_allocfailure in xfs.Signed-off-by Nikanth Karthikesan <[email protected]>
NAK, as already explained by Jens.