RE: [PATCH] mpt3sas: Fix calltrace observed while running IO & host reset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bart,
 When host reset is issued from application, through ioctl reset handler
_ctl_do_reset() -> mpt3sas_base_hard_reset_handler() sets
“ioc->shost_recovery” flag.
If “ioc->shost_recovery” flag is set then driver will return all the
incoming SCSI cmds with “SCSI_MLQUEUE_HOST_BUSY” in the scsih_qcmd(). And
hence no new request gets processed by the driver until the reset completes,
which guarantees that the smid won't change.

Thanks,
 Chaitra

-----Original Message-----
From: Bart Van Assche [mailto:Bart.VanAssche@xxxxxxx]
Sent: Tuesday, June 12, 2018 8:54 PM
To: chaitra.basappa@xxxxxxxxxxxx; linux-scsi@xxxxxxxxxxxxxxx
Cc: sathya.prakash@xxxxxxxxxxxx; suganath-prabu.subramani@xxxxxxxxxxxx;
Sreekanth.Reddy@xxxxxxxxxxxx
Subject: Re: [PATCH] mpt3sas: Fix calltrace observed while running IO & host
reset

On Tue, 2018-06-12 at 09:17 -0400, Chaitra P B wrote:
> diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> index 23902ad..96e523a 100644
> --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> @@ -1489,7 +1489,7 @@ struct scsi_cmnd *
>  		scmd = scsi_host_find_tag(ioc->shost, unique_tag);
>  		if (scmd) {
>  			st = scsi_cmd_priv(scmd);
> -			if (st->cb_idx == 0xFF)
> +			if (st->cb_idx == 0xFF || st->smid == 0)
>  				scmd = NULL;
>  		}
>  	}

What guarantees that st->smid won't change after it has been checked and
before scmd is used?

Thanks,

Bart.




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux