aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-core.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2009-05-19 13:52:35 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-05-19 13:52:35 -0400
commit53674ac5a997a8eedbb2dfdc308b895170746c8b (patch)
tree69fb2c7c2d9726e0ff3a8bc491b5bf1fc5e2d1d4 /block/blk-core.c
parenta411f4bbb89f1f08687b344064d6775bce1e4658 (diff)
block: add warning to blk_make_request()
Add a note about how one needs to be careful when setting up these bio chains. Extracted from Boaz's updated patch. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r--block/blk-core.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index bec1d69952d0..49065075d462 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -910,6 +910,15 @@ EXPORT_SYMBOL(blk_get_request);
910 * need bouncing, by calling the appropriate masked or flagged allocator, 910 * need bouncing, by calling the appropriate masked or flagged allocator,
911 * suitable for the target device. Otherwise the call to blk_queue_bounce will 911 * suitable for the target device. Otherwise the call to blk_queue_bounce will
912 * BUG. 912 * BUG.
913 *
914 * WARNING: When allocating/cloning a bio-chain, careful consideration should be
915 * given to how you allocate bios. In particular, you cannot use __GFP_WAIT for
916 * anything but the first bio in the chain. Otherwise you risk waiting for IO
917 * completion of a bio that hasn't been submitted yet, thus resulting in a
918 * deadlock. Alternatively bios should be allocated using bio_kmalloc() instead
919 * of bio_alloc(), as that avoids the mempool deadlock.
920 * If possible a big IO should be split into smaller parts when allocation
921 * fails. Partial allocation should not be an error, or you risk a live-lock.
913 */ 922 */
914struct request *blk_make_request(struct request_queue *q, struct bio *bio, 923struct request *blk_make_request(struct request_queue *q, struct bio *bio,
915 gfp_t gfp_mask) 924 gfp_t gfp_mask)