OSDN Git Service

blk-mq: handle NULL req return from blk_map_request in single queue mode
authorJens Axboe <axboe@fb.com>
Tue, 3 Jun 2014 17:59:49 +0000 (11:59 -0600)
committerJens Axboe <axboe@fb.com>
Wed, 4 Jun 2014 03:04:39 +0000 (21:04 -0600)
blk_mq_map_request() can return NULL if we fail entering the queue
(dying, or removed), in which case it has already ended IO on the
bio. So nothing more to do, except just return.

Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq.c

index 3bb4cfe..96e6eb6 100644 (file)
@@ -1276,6 +1276,8 @@ static void blk_sq_make_request(struct request_queue *q, struct bio *bio)
                return;
 
        rq = blk_mq_map_request(q, bio, &data);
+       if (unlikely(!rq))
+               return;
 
        if (unlikely(is_flush_fua)) {
                blk_mq_bio_to_request(rq, bio);