[SCSI] ALUA: send STPG if explicit and implicit is supported
authorMike Christie <michaelc@cs.wisc.edu>
Wed, 29 Jul 2009 04:08:06 +0000 (23:08 -0500)
committerJames Bottomley <James.Bottomley@suse.de>
Sat, 22 Aug 2009 22:52:01 +0000 (17:52 -0500)
alua_activate only sends a STPG if only explicit is suppored.
As a result, for EMC targets that support both we end up doing
a implicit failover when X commands are finally sent to
the other SP.

This patch does a AND on the h->tpgs, so we do a explicit failover
right away.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/device_handler/scsi_dh_alua.c

index dba154c..b5cdefa 100644 (file)
@@ -663,7 +663,7 @@ static int alua_activate(struct scsi_device *sdev)
                        goto out;
        }
 
-       if (h->tpgs == TPGS_MODE_EXPLICIT && h->state != TPGS_STATE_OPTIMIZED)
+       if (h->tpgs & TPGS_MODE_EXPLICIT && h->state != TPGS_STATE_OPTIMIZED)
                err = alua_stpg(sdev, TPGS_STATE_OPTIMIZED, h);
 
 out: