diff options
author | Christoph Hellwig <hch@lst.de> | 2014-09-14 01:40:09 +0200 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-09-22 20:00:07 +0200 |
commit | e2490073cd7c3d6f6ef6e029a208edd4d38efac4 (patch) | |
tree | 48465e67b335f6d696d698641365b4a4d1e89d32 /drivers/block/null_blk.c | |
parent | blk-mq: remove REQ_END (diff) | |
download | linux-e2490073cd7c3d6f6ef6e029a208edd4d38efac4.tar.xz linux-e2490073cd7c3d6f6ef6e029a208edd4d38efac4.zip |
blk-mq: call blk_mq_start_request from ->queue_rq
When we call blk_mq_start_request from the core blk-mq code before calling into
->queue_rq there is a racy window where the timeout handler can hit before we've
fully set up the driver specific part of the command.
Move the call to blk_mq_start_request into the driver so the driver can start
the request only once it is fully set up.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block/null_blk.c')
-rw-r--r-- | drivers/block/null_blk.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c index c5b7315c2c13..332ce20d45da 100644 --- a/drivers/block/null_blk.c +++ b/drivers/block/null_blk.c @@ -321,6 +321,8 @@ static int null_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *rq, cmd->rq = rq; cmd->nq = hctx->driver_data; + blk_mq_start_request(rq); + null_handle_cmd(cmd); return BLK_MQ_RQ_QUEUE_OK; } |