提交 441fbd25 编写于 作者: N Narsimhulu Musini 提交者: James Bottomley

[SCSI] fnic: host reset returns nonzero value(errno) on success

Fixed appropriate error codes that returns negative error number on failure,
and 0 on success. fnic_reset() is used directly by the fc transport callback
issue_fc_host_lip which requires a negative error number on failure.
Signed-off-by: NNarsimhulu Musini <nmusini@cisco.com>
Signed-off-by: NHiral Patel <hiralpat@cisco.com>
Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
上级 522db3c9
...@@ -2207,7 +2207,7 @@ int fnic_reset(struct Scsi_Host *shost) ...@@ -2207,7 +2207,7 @@ int fnic_reset(struct Scsi_Host *shost)
{ {
struct fc_lport *lp; struct fc_lport *lp;
struct fnic *fnic; struct fnic *fnic;
int ret = SUCCESS; int ret = 0;
lp = shost_priv(shost); lp = shost_priv(shost);
fnic = lport_priv(lp); fnic = lport_priv(lp);
...@@ -2219,12 +2219,11 @@ int fnic_reset(struct Scsi_Host *shost) ...@@ -2219,12 +2219,11 @@ int fnic_reset(struct Scsi_Host *shost)
* Reset local port, this will clean up libFC exchanges, * Reset local port, this will clean up libFC exchanges,
* reset remote port sessions, and if link is up, begin flogi * reset remote port sessions, and if link is up, begin flogi
*/ */
if (lp->tt.lport_reset(lp)) ret = lp->tt.lport_reset(lp);
ret = FAILED;
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
"Returning from fnic reset %s\n", "Returning from fnic reset %s\n",
(ret == SUCCESS) ? (ret == 0) ?
"SUCCESS" : "FAILED"); "SUCCESS" : "FAILED");
return ret; return ret;
...@@ -2251,7 +2250,7 @@ int fnic_host_reset(struct scsi_cmnd *sc) ...@@ -2251,7 +2250,7 @@ int fnic_host_reset(struct scsi_cmnd *sc)
* scsi-ml tries to send a TUR to every device if host reset is * scsi-ml tries to send a TUR to every device if host reset is
* successful, so before returning to scsi, fabric should be up * successful, so before returning to scsi, fabric should be up
*/ */
ret = fnic_reset(shost); ret = (fnic_reset(shost) == 0) ? SUCCESS : FAILED;
if (ret == SUCCESS) { if (ret == SUCCESS) {
wait_host_tmo = jiffies + FNIC_HOST_RESET_SETTLE_TIME * HZ; wait_host_tmo = jiffies + FNIC_HOST_RESET_SETTLE_TIME * HZ;
ret = FAILED; ret = FAILED;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册