提交 378eeade 编写于 作者: B Bart Van Assche 提交者: Martin K. Petersen

scsi: scsi_transport_fc: Hold queue lock while calling blk_run_queue_async()

It is required to hold the queue lock when calling blk_run_queue_async()
to avoid that a race between blk_run_queue_async() and
blk_cleanup_queue() is triggered. Additionally, remove the get_device()
and put_device() calls from fc_bsg_goose_queue. It is namely the
responsibility of the caller of fc_bsg_goose_queue() to ensure that the
bsg queue does not disappear while fc_bsg_goose_queue() is in progress.
Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: James Smart <james.smart@avagotech.com>
Reviewed-by: NJames Smart <james.smart@broadcom.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 7b93ca43
......@@ -3855,15 +3855,15 @@ fc_bsg_host_dispatch(struct request_queue *q, struct Scsi_Host *shost,
static void
fc_bsg_goose_queue(struct fc_rport *rport)
{
if (!rport->rqst_q)
struct request_queue *q = rport->rqst_q;
unsigned long flags;
if (!q)
return;
/*
* This get/put dance makes no sense
*/
get_device(&rport->dev);
blk_run_queue_async(rport->rqst_q);
put_device(&rport->dev);
spin_lock_irqsave(q->queue_lock, flags);
blk_run_queue_async(q);
spin_unlock_irqrestore(q->queue_lock, flags);
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册