Re: [PATCH] fnic: Correcting rport check location in fnic_queuecommand_lck

2016-11-16 Thread Martin K. Petersen
> "Satish" == Satish Kharat  writes:

Applied to 4.10/scsi-queue. Please add a more verbose patch description
next time.

-- 
Martin K. Petersen  Oracle Linux Engineering
--
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


Re: [PATCH] fnic: Correcting rport check location in fnic_queuecommand_lck

2016-11-16 Thread Tomas Henzl
On 16.11.2016 09:54, Satish Kharat wrote:
> Signed-off-by: Satish Kharat 
> Signed-off-by: Sesidhar Baddela 

Looks good,

Reviewed-by: Tomas Henzl 

Tomas

--
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


[PATCH] fnic: Correcting rport check location in fnic_queuecommand_lck

2016-11-16 Thread Satish Kharat
Signed-off-by: Satish Kharat 
Signed-off-by: Sesidhar Baddela 
---
 drivers/scsi/fnic/fnic_scsi.c | 28 ++--
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
index bfaba06..2544a37 100644
--- a/drivers/scsi/fnic/fnic_scsi.c
+++ b/drivers/scsi/fnic/fnic_scsi.c
@@ -441,30 +441,38 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, 
void (*done)(struct scsi_
unsigned long ptr;
spinlock_t *io_lock = NULL;
int io_lock_acquired = 0;
+   struct fc_rport_libfc_priv *rp;
 
if (unlikely(fnic_chk_state_flags_locked(fnic, FNIC_FLAGS_IO_BLOCKED)))
return SCSI_MLQUEUE_HOST_BUSY;
 
rport = starget_to_rport(scsi_target(sc->device));
+   if (!rport) {
+   FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
+   "returning DID_NO_CONNECT for IO as rport is 
NULL\n");
+   sc->result = DID_NO_CONNECT << 16;
+   done(sc);
+   return 0;
+   }
+
ret = fc_remote_port_chkready(rport);
if (ret) {
+   FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
+   "rport is not ready\n");
atomic64_inc(_stats->misc_stats.rport_not_ready);
sc->result = ret;
done(sc);
return 0;
}
 
-   if (rport) {
-   struct fc_rport_libfc_priv *rp = rport->dd_data;
-
-   if (!rp || rp->rp_state != RPORT_ST_READY) {
-   FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
+   rp = rport->dd_data;
+   if (!rp || rp->rp_state != RPORT_ST_READY) {
+   FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
"returning DID_NO_CONNECT for IO as rport is 
removed\n");
-   atomic64_inc(_stats->misc_stats.rport_not_ready);
-   sc->result = DID_NO_CONNECT<<16;
-   done(sc);
-   return 0;
-   }
+   atomic64_inc(_stats->misc_stats.rport_not_ready);
+   sc->result = DID_NO_CONNECT<<16;
+   done(sc);
+   return 0;
}
 
if (lp->state != LPORT_ST_READY || !(lp->link_up))
-- 
2.5.5

--
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