diff options
author | Jens Axboe <axboe@kernel.dk> | 2018-11-18 15:46:03 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-11-18 15:46:03 -0700 |
commit | a78b03bc7300e4f17b1e510884bea1095d92b17b (patch) | |
tree | 855f219806462da09c8021b27848c58713bb1807 /drivers/scsi/scsi_lib.c | |
parent | fce15a609f8f30cfacfaf684729add9582be780b (diff) | |
parent | 9ff01193a20d391e8dbce4403dd5ef87c7eaaca6 (diff) | |
download | lwn-a78b03bc7300e4f17b1e510884bea1095d92b17b.tar.gz lwn-a78b03bc7300e4f17b1e510884bea1095d92b17b.zip |
Merge tag 'v4.20-rc3' into for-4.21/block
Merge in -rc3 to resolve a few conflicts, but also to get a few
important fixes that have gone into mainline since the block
4.21 branch was forked off (most notably the SCSI queue issue,
which is both a conflict AND needed fix).
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 5d83a162d03b..0df15cb738d2 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -610,6 +610,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 || @@ -618,6 +624,7 @@ 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; } |