[PATCH 12/24] fnic: use fc_block_rport() correctly

Hannes Reinecke
2022-05-02T21:39:07Z

Use fc_block_rport() instead of fc_block_scsi_eh() and evaluate
the return value to avoid issuing TMF commands when the port
is still blocked.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/scsi/fnic/fnic_scsi.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
index b2ba731b67de..fb6dc59a5a7e 100644
--- a/drivers/scsi/fnic/fnic_scsi.c
+++ b/drivers/scsi/fnic/fnic_scsi.c
@@ -1733,9 +1733,6 @@ int fnic_abort_cmd(struct scsi_cmnd *sc)
unsigned long abt_issued_time;
DECLARE_COMPLETION_ONSTACK(tm_done);

- /* Wait for rport to unblock */
- fc_block_scsi_eh(sc);
-
/* Get local-port, check ready and link up */
lp = shost_priv(sc->device->host);

@@ -1745,6 +1742,10 @@ int fnic_abort_cmd(struct scsi_cmnd *sc)
term_stats = &fnic->fnic_stats.term_stats;

rport = starget_to_rport(scsi_target(sc->device));
+ ret = fc_block_rport(rport);
+ if (ret)
+ return ret;
+
FNIC_SCSI_DBG(KERN_DEBUG,
fnic->lport->host,
"Abort Cmd called FCID 0x%x, LUN 0x%llx TAG %x flags %x\n",
--
2.29.2