aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ipr.c
diff options
context:
space:
mode:
authorWayne Boyer <wayneb@linux.vnet.ibm.com>2010-11-04 12:35:58 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-12-21 13:23:54 -0500
commit0cb992eda1f7e7672775032378690baa87c0e13d (patch)
treea39c519e78130b5ee3f526763794213003ea560a /drivers/scsi/ipr.c
parent24d720b726c1a85f1962831ac30ad4d2ef8276b1 (diff)
[SCSI] ipr: fix lun assignment and comparison
The lun value was not getting set up correctly for all devices attached to the new 64 bit adapters. The fix is to move the logic to earlier in the ipr_init_res_entry routine such that the value does get set correctly for all devices. Then the ipr_is_same_device comparison function was using the wrong lun value in the logic for the new adapters. Change this to use the correct lun value. Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com> Acked-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/ipr.c')
-rw-r--r--drivers/scsi/ipr.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 5bbaee597e88..04c1cea89dbe 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -1048,6 +1048,8 @@ static void ipr_init_res_entry(struct ipr_resource_entry *res,
1048 sizeof(res->res_path)); 1048 sizeof(res->res_path));
1049 1049
1050 res->bus = 0; 1050 res->bus = 0;
1051 memcpy(&res->dev_lun.scsi_lun, &cfgtew->u.cfgte64->lun,
1052 sizeof(res->dev_lun.scsi_lun));
1051 res->lun = scsilun_to_int(&res->dev_lun); 1053 res->lun = scsilun_to_int(&res->dev_lun);
1052 1054
1053 if (res->type == IPR_RES_TYPE_GENERIC_SCSI) { 1055 if (res->type == IPR_RES_TYPE_GENERIC_SCSI) {
@@ -1063,9 +1065,6 @@ static void ipr_init_res_entry(struct ipr_resource_entry *res,
1063 ioa_cfg->max_devs_supported); 1065 ioa_cfg->max_devs_supported);
1064 set_bit(res->target, ioa_cfg->target_ids); 1066 set_bit(res->target, ioa_cfg->target_ids);
1065 } 1067 }
1066
1067 memcpy(&res->dev_lun.scsi_lun, &cfgtew->u.cfgte64->lun,
1068 sizeof(res->dev_lun.scsi_lun));
1069 } else if (res->type == IPR_RES_TYPE_IOAFP) { 1068 } else if (res->type == IPR_RES_TYPE_IOAFP) {
1070 res->bus = IPR_IOAFP_VIRTUAL_BUS; 1069 res->bus = IPR_IOAFP_VIRTUAL_BUS;
1071 res->target = 0; 1070 res->target = 0;
@@ -1116,7 +1115,7 @@ static int ipr_is_same_device(struct ipr_resource_entry *res,
1116 if (res->ioa_cfg->sis64) { 1115 if (res->ioa_cfg->sis64) {
1117 if (!memcmp(&res->dev_id, &cfgtew->u.cfgte64->dev_id, 1116 if (!memcmp(&res->dev_id, &cfgtew->u.cfgte64->dev_id,
1118 sizeof(cfgtew->u.cfgte64->dev_id)) && 1117 sizeof(cfgtew->u.cfgte64->dev_id)) &&
1119 !memcmp(&res->lun, &cfgtew->u.cfgte64->lun, 1118 !memcmp(&res->dev_lun.scsi_lun, &cfgtew->u.cfgte64->lun,
1120 sizeof(cfgtew->u.cfgte64->lun))) { 1119 sizeof(cfgtew->u.cfgte64->lun))) {
1121 return 1; 1120 return 1;
1122 } 1121 }