diff options
author | Joel Stanley <joel@jms.id.au> | 2018-11-27 08:23:56 +0300 |
---|---|---|
committer | Joel Stanley <joel@jms.id.au> | 2018-11-27 08:24:09 +0300 |
commit | d608acfd4ac3fe17f3081bee8fcd4dcd896c2ffa (patch) | |
tree | ade4450a72a2e358a1d2e5cde321de0097fb291c /drivers/scsi/scsi_lib.c | |
parent | 62ccc3924eff37012bd0c227d8b7dc71188fc358 (diff) | |
parent | a9da8725b7a744be3ff0ff44cab2547e4d1e6675 (diff) | |
download | linux-dev-4.18.tar.xz |
Merge tag 'v4.18.20' into dev-4.18dev-4.18
This is the 4.18.20 stable release
Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 41e9ac9fc138..4fd92b1802cd 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -696,6 +696,12 @@ 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 || @@ -703,6 +709,8 @@ static bool scsi_end_request(struct request *req, blk_status_t error, kblockd_schedule_work(&sdev->requeue_work); else blk_mq_run_hw_queues(q, true); + + percpu_ref_put(&q->q_usage_counter); } else { unsigned long flags; |