ACK: [SRU][Focal] scsi: fnic: Do not call 'scsi_done()' for unhandled commands

Stefan Bader stefan.bader at canonical.com
Mon Oct 4 09:18:22 UTC 2021


On 27.09.21 16:17, Eric Desrochers wrote:
> From: Hannes Reinecke <hare at suse.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1944586
> 
> The fnic drivers assigns an ioreq structure to each command and severs this
> assignment once scsi_done() has been called and the command has been
> completed.
> 
> When traversing commands to terminate outstanding I/O we should not call
> scsi_done() on commands which do not have a corresponding ioreq structure;
> these commands have either never entered the driver or have already been
> completed.
> 
> [mkp: fixed unused label warning]
> 
> Link: https://lore.kernel.org/r/20200515112647.49260-1-hare@suse.de
> Reported-by: kbuild test robot <lkp at intel.com>
> Reviewed-by: Laurence Oberman <loberman at redhat.com>
> Acked-by: Satish Kharat <satishkh at cisco.com>
> Acked-by: Karan Tilak Kumar <kartilak at cisco.com>
> Signed-off-by: Hannes Reinecke <hare at suse.com>
> Signed-off-by: Martin K. Petersen <martin.petersen at oracle.com>
> (cherry picked from commit 712582e60f288e7cede8d6fc8769529317e0f3e0)
> Signed-off-by: Eric Desrochers <eric.desrochers at canonical.com>
Acked-by: Stefan Bader <stefan.bader at canonical.com>
> ---
>   drivers/scsi/fnic/fnic_scsi.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
> index b60795893994..1630fae6af1c 100644
> --- a/drivers/scsi/fnic/fnic_scsi.c
> +++ b/drivers/scsi/fnic/fnic_scsi.c
> @@ -1401,7 +1401,7 @@ static void fnic_cleanup_io(struct fnic *fnic, int exclude_id)
>   		}
>   		if (!io_req) {
>   			spin_unlock_irqrestore(io_lock, flags);
> -			goto cleanup_scsi_cmd;
> +			continue;
>   		}
>   
>   		CMD_SP(sc) = NULL;
> @@ -1416,7 +1416,6 @@ static void fnic_cleanup_io(struct fnic *fnic, int exclude_id)
>   		fnic_release_ioreq_buf(fnic, io_req, sc);
>   		mempool_free(io_req, fnic->io_req_pool);
>   
> -cleanup_scsi_cmd:
>   		sc->result = DID_TRANSPORT_DISRUPTED << 16;
>   		FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
>   			      "%s: tag:0x%x : sc:0x%p duration = %lu DID_TRANSPORT_DISRUPTED\n",
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20211004/e42270d5/attachment.sig>


More information about the kernel-team mailing list