]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
[SCSI] scsi_dh_alua: Fix Erroneous TPG ID check
authorHannes Reinecke <hare@suse.de>
Wed, 24 Aug 2011 08:51:18 +0000 (10:51 +0200)
committerJames Bottomley <JBottomley@Parallels.com>
Tue, 30 Aug 2011 19:32:41 +0000 (12:32 -0700)
For Target Portal Group IDs occupying the full 2 bytes in the
RTPG response, the following group_id check in the alua_rtpg
routine always fails in scsi_dh_alua.c:

if (h->group_id == (ucp[2] << 8) + ucp[3]) {

This causes the ALUA handler to wrongly identify the AAS of
a specified device as well as incorrectly interpreting the
supported AAS of the target as seen by the following entries
in the /var/log/messages:

"alua: port group 3ea state A supports tousna"
"alua: port group 3e9 state A supports tousna"

This is because 'ucp' is wrongly declared in alua_rtpg as
a character pointer instead of an unsigned character pointer.

Signed-off-by: Martin George <marting@netapp.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/device_handler/scsi_dh_alua.c

index f44dbf69843a23ee53a8548f580d13380d89d9ae..34c66118dfc473aaf39fa34a2fa74dc55bc1a502 100644 (file)
@@ -504,7 +504,7 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_dh_data *h)
 {
        struct scsi_sense_hdr sense_hdr;
        int len, k, off, valid_states = 0;
-       char *ucp;
+       unsigned char *ucp;
        unsigned err;
        unsigned long expiry, interval = 10;