changeset 10904:3924624ae267

6739984 Solaris failed to do any failover for any volume with TPGS.
author Chris Liu <Chris.Liu@Sun.COM>
date Thu, 29 Oct 2009 20:06:56 +0800
parents 65dc46bd2696
children 3295b315d7d3
files usr/src/uts/common/io/scsi/adapters/scsi_vhci/fops/tpgs.c usr/src/uts/common/io/scsi/adapters/scsi_vhci/mpapi_impl.c usr/src/uts/common/io/scsi/adapters/scsi_vhci/scsi_vhci_tpgs.c
diffstat 3 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/io/scsi/adapters/scsi_vhci/fops/tpgs.c	Thu Oct 29 10:27:54 2009 +0800
+++ b/usr/src/uts/common/io/scsi/adapters/scsi_vhci/fops/tpgs.c	Thu Oct 29 20:06:56 2009 +0800
@@ -248,7 +248,7 @@
 		return (0);
 	}
 
-	if (mode != SCSI_IMPLICIT_FAILOVER) {
+	if (mode == SCSI_EXPLICIT_FAILOVER) {
 		VHCI_DEBUG(4, (CE_NOTE, NULL,
 		    "!mode is EXPLICIT for %p xlf %x\n",
 		    (void *)sd, xlf));
--- a/usr/src/uts/common/io/scsi/adapters/scsi_vhci/mpapi_impl.c	Thu Oct 29 10:27:54 2009 +0800
+++ b/usr/src/uts/common/io/scsi/adapters/scsi_vhci/mpapi_impl.c	Thu Oct 29 20:06:56 2009 +0800
@@ -1655,7 +1655,12 @@
 			} else {
 				vhci_update_pathstates((void *)svl);
 			}
-			if (desired_state != mptpgd->prop.accessState) {
+			if (desired_state != mptpgd->prop.accessState
+			    (desired_state != MP_DRVR_ACCESS_STATE_ACTIVE ||
+			    (mptpgd->prop.accessState !=
+			    MP_DRVR_ACCESS_STATE_ACTIVE_OPTIMIZED &&
+			    mptpgd->prop.accessState !=
+			    MP_DRVR_ACCESS_STATE_ACTIVE_NONOPTIMIZED))) {
 				VHCI_DEBUG(1, (CE_WARN, NULL, "vhci_set_tpg_"
 				    "access_state: TPGAccessState NOT Set: "
 				    "des_state=%x, cur_state=%x", desired_state,
--- a/usr/src/uts/common/io/scsi/adapters/scsi_vhci/scsi_vhci_tpgs.c	Thu Oct 29 10:27:54 2009 +0800
+++ b/usr/src/uts/common/io/scsi/adapters/scsi_vhci/scsi_vhci_tpgs.c	Thu Oct 29 20:06:56 2009 +0800
@@ -75,7 +75,7 @@
 	}
 
 	bp->b_un.b_addr = bufp;
-	bp->b_flags = B_READ;
+	bp->b_flags = B_WRITE;
 	bp->b_bcount = len;
 	bp->b_resid = 0;
 
@@ -172,6 +172,12 @@
 			scsi_destroy_pkt(pkt);
 			return (0);
 		}
+	} else if ((pkt->pkt_reason == CMD_CMPLT) &&
+	    (SCBP_C(pkt) == STATUS_GOOD)) {
+		freerbuf(bp);
+		kmem_free((void *)bufp, len);
+		scsi_destroy_pkt(pkt);
+		return (0);
 	}
 
 	freerbuf(bp);