]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
fnic: return zero on fnic_reset() success
authorJoe Jin <joe.jin@oracle.com>
Thu, 19 Jan 2012 08:04:25 +0000 (16:04 +0800)
committerJoe Jin <joe.jin@oracle.com>
Thu, 16 Feb 2012 00:04:07 +0000 (08:04 +0800)
When issue LIP by sysfs found write("1") returned 8194, this caused by
fnic_reset() return SUCCESS to store_fc_private_host_issue_lip(). Return 0/-1
for fnic_reset() fix this issue.

Tested-by: Sriharsha <sriharsha.devdas@oracle.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
Cc: Abhijeet Joglekar <abjoglek@cisco.com>
Cc: Venkata Siva Vijayendra Bhamidipati <vbhamidi@cisco.com>
Cc: Brian Uchino <buchino@cisco.com>
CC: stable@vger.kernel.org
drivers/scsi/fnic/fnic_scsi.c

index 538b31c2cf58037e96828e7dedfc87cf9074d44e..4873d918451740e18b446d95df50236654dd138e 100644 (file)
@@ -1662,7 +1662,7 @@ int fnic_reset(struct Scsi_Host *shost)
 {
        struct fc_lport *lp;
        struct fnic *fnic;
-       int ret = SUCCESS;
+       int ret = 0;
 
        lp = shost_priv(shost);
        fnic = lport_priv(lp);
@@ -1675,11 +1675,11 @@ int fnic_reset(struct Scsi_Host *shost)
         * reset remote port sessions, and if link is up, begin flogi
         */
        if (lp->tt.lport_reset(lp))
-               ret = FAILED;
+               ret = -1;
 
        FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
                      "Returning from fnic reset %s\n",
-                     (ret == SUCCESS) ?
+                     (ret == 0) ?
                      "SUCCESS" : "FAILED");
 
        return ret;
@@ -1706,7 +1706,7 @@ int fnic_host_reset(struct scsi_cmnd *sc)
         * scsi-ml tries to send a TUR to every device if host reset is
         * successful, so before returning to scsi, fabric should be up
         */
-       ret = fnic_reset(shost);
+       ret = (fnic_reset(shost) == 0) ? SUCCESS : FAILED;
        if (ret == SUCCESS) {
                wait_host_tmo = jiffies + FNIC_HOST_RESET_SETTLE_TIME * HZ;
                ret = FAILED;