On 09/29/2016 01:45 AM, Bart Van Assche wrote:
> The code at the end of alua_rtpg_work() is as follows:
> 
>       scsi_device_put(sdev);
>       kref_put(&pg->kref, release_port_group);
> 
> Make sure that all code that queues the work item associated
> with alua_rtpg_work() holds both references.
> 
> Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
> Cc: Hannes Reinecke <h...@suse.com>
> Cc: <sta...@vger.kernel.org>
> ---
>  drivers/scsi/device_handler/scsi_dh_alua.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c 
> b/drivers/scsi/device_handler/scsi_dh_alua.c
> index 752b5c9..f7099e2 100644
> --- a/drivers/scsi/device_handler/scsi_dh_alua.c
> +++ b/drivers/scsi/device_handler/scsi_dh_alua.c
> @@ -889,6 +889,7 @@ static void alua_rtpg_queue(struct alua_port_group *pg,
>               /* Do not queue if the worker is already running */
>               if (!(pg->flags & ALUA_PG_RUNNING)) {
>                       kref_get(&pg->kref);
> +                     scsi_device_get(sdev);
>                       start_queue = 1;
>               }
>       }
> 
Nack.

The scsi device reference tracks ->rtpg_sdev, not the queue item.
So we only need to take the scsi device reference if we're assigning a
new value to ->rtpg_sdev, which we are not.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                   zSeries & Storage
h...@suse.de                          +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to