Re: [PATCH 08/18] snic: use reserved commands

Bart Van Assche
2021-05-04T03:12:39Z

On 5/3/21 8:03 AM, Hannes Reinecke wrote:
> @@ -2170,42 +2144,42 @@ snic_device_reset(struct scsi_cmnd *sc)
> goto dev_rst_end;
> }
>
> - /* There is no tag when lun reset is issue through ioctl. */
> - if (unlikely(tag <= SNIC_NO_TAG)) {
> - SNIC_HOST_INFO(snic->shost,
> - "Devrst: LUN Reset Recvd thru IOCTL.\n");
> + reset_sc = scsi_get_internal_cmd(sc->device, REQ_OP_SCSI_IN,
> + BLK_MQ_REQ_NOWAIT);
> + if (!reset_sc)
> + goto dev_rst_end;

The SCSI error handler may call .eh_device_reset_handler and other error
handling callbacks if no tags are available. If no tags are available,
scsi_get_internal_cmd() will fail. If scsi_get_internal_cmd() fails,
snic_device_reset() will fail. Does that count as a regression?

Thanks,

Bart.