On 3/31/19 11:09 AM, Ming Lei wrote: > Now resources for dispatch is freed in queue's release handler, > we don't need to worry about the possible race between blk_cleanup_queue > and run queue. > > So don't grab the queue usage counter before run queue in > scsi_end_request(). Similar to prior one. If something similar to do in the future, can we have "this is revert of 8dc765d438f1 ("SCSI: fix queue cleanup race before queue initialization is done")......" Thank you very much! Dongli Zhang > > Cc: James Smart <james.smart@xxxxxxxxxxxx> > Cc: Bart Van Assche <bart.vanassche@xxxxxxx> > Cc: linux-scsi@xxxxxxxxxxxxxxx, > Cc: Martin K . Petersen <martin.petersen@xxxxxxxxxx>, > Cc: Christoph Hellwig <hch@xxxxxx>, > Cc: James E . J . Bottomley <jejb@xxxxxxxxxxxxxxxxxx>, > Cc: jianchao wang <jianchao.w.wang@xxxxxxxxxx> > Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxx> > --- > drivers/scsi/scsi_lib.c | 7 ------- > 1 file changed, 7 deletions(-) > > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > index 601b9f1de267..18bf341d1236 100644 > --- a/drivers/scsi/scsi_lib.c > +++ b/drivers/scsi/scsi_lib.c > @@ -604,12 +604,6 @@ static bool scsi_end_request(struct request *req, blk_status_t error, > */ > scsi_mq_uninit_cmd(cmd); > > - /* > - * queue is still alive, so grab the ref for preventing it > - * from being cleaned up during running queue. > - */ > - percpu_ref_get(&q->q_usage_counter); > - > __blk_mq_end_request(req, error); > > if (scsi_target(sdev)->single_lun || > @@ -618,7 +612,6 @@ static bool scsi_end_request(struct request *req, blk_status_t error, > else > blk_mq_run_hw_queues(q, true); > > - percpu_ref_put(&q->q_usage_counter); > put_device(&sdev->sdev_gendev); > return false; > } >