summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_lib.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-09-13 16:40:09 -0700
committerJens Axboe <axboe@fb.com>2014-09-22 12:00:07 -0600
commite2490073cd7c3d6f6ef6e029a208edd4d38efac4 (patch)
tree48465e67b335f6d696d698641365b4a4d1e89d32 /drivers/scsi/scsi_lib.c
parentbf57229745f849e500ba69ff91e35bc8160a7373 (diff)
downloadlinux-stable-e2490073cd7c3d6f6ef6e029a208edd4d38efac4.tar.gz
linux-stable-e2490073cd7c3d6f6ef6e029a208edd4d38efac4.tar.bz2
linux-stable-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/scsi/scsi_lib.c')
-rw-r--r--drivers/scsi/scsi_lib.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index f1df41168391..2dcd9078de48 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1890,6 +1890,7 @@ static int scsi_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *req,
scsi_init_cmd_errh(cmd);
cmd->scsi_done = scsi_mq_done;
+ blk_mq_start_request(req);
reason = scsi_dispatch_cmd(cmd);
if (reason) {
scsi_set_blocked(cmd, reason);