Skip to content

Commit

Permalink
scsi: fnic: Replace return codes in fnic_clean_pending_aborts()
Browse files Browse the repository at this point in the history
fnic_clean_pending_aborts() was returning a non-zero value irrespective of
failure or success.  This caused the caller of this function to assume that
the device reset had failed, even though it would succeed in most cases. As
a consequence, a successful device reset would escalate to host reset.

Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com>
Tested-by: Karan Tilak Kumar <kartilak@cisco.com>
Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com>
Link: https://lore.kernel.org/r/20230727193919.2519-1-kartilak@cisco.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Karan Tilak Kumar authored and Martin K. Petersen committed Jul 31, 2023
1 parent 175544a commit 5a43b07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/scsi/fnic/fnic.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#define DRV_NAME "fnic"
#define DRV_DESCRIPTION "Cisco FCoE HBA Driver"
#define DRV_VERSION "1.6.0.54"
#define DRV_VERSION "1.6.0.55"
#define PFX DRV_NAME ": "
#define DFX DRV_NAME "%d: "

Expand Down
6 changes: 4 additions & 2 deletions drivers/scsi/fnic/fnic_scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2139,7 +2139,7 @@ static int fnic_clean_pending_aborts(struct fnic *fnic,
bool new_sc)

{
int ret = SUCCESS;
int ret = 0;
struct fnic_pending_aborts_iter_data iter_data = {
.fnic = fnic,
.lun_dev = lr_sc->device,
Expand All @@ -2159,9 +2159,11 @@ static int fnic_clean_pending_aborts(struct fnic *fnic,

/* walk again to check, if IOs are still pending in fw */
if (fnic_is_abts_pending(fnic, lr_sc))
ret = FAILED;
ret = 1;

clean_pending_aborts_end:
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host,
"%s: exit status: %d\n", __func__, ret);
return ret;
}

Expand Down

0 comments on commit 5a43b07

Please sign in to comment.