diff options
author | Wayne Boyer <wayneb@linux.vnet.ibm.com> | 2010-09-27 13:45:28 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-10-07 18:24:44 -0400 |
commit | 7262026f0eded76b935a12b9b15af05516a8610a (patch) | |
tree | a66ae900a7528feda79e9f5b40f4ec137de8aa00 | |
parent | 4ebcfb929b6be63bacdba34f6aae0f5b51432d2c (diff) |
[SCSI] ipr: fix array error logging
The structure definitions for reporting array errors did not have the correct
size for the Array WWID field. This patch fixes those definitions. It also
fixes part of the output formatting that did not have newlines and fixes size
calculations.
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>
-rw-r--r-- | drivers/scsi/ipr.c | 10 | ||||
-rw-r--r-- | drivers/scsi/ipr.h | 9 |
2 files changed, 12 insertions, 7 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 3b28e8728131..df9a12c8b373 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -1671,7 +1671,7 @@ static void ipr_log_enhanced_array_error(struct ipr_ioa_cfg *ioa_cfg, | |||
1671 | 1671 | ||
1672 | array_entry = error->array_member; | 1672 | array_entry = error->array_member; |
1673 | num_entries = min_t(u32, be32_to_cpu(error->num_entries), | 1673 | num_entries = min_t(u32, be32_to_cpu(error->num_entries), |
1674 | sizeof(error->array_member)); | 1674 | ARRAY_SIZE(error->array_member)); |
1675 | 1675 | ||
1676 | for (i = 0; i < num_entries; i++, array_entry++) { | 1676 | for (i = 0; i < num_entries; i++, array_entry++) { |
1677 | if (!memcmp(array_entry->vpd.vpd.sn, zero_sn, IPR_SERIAL_NUM_LEN)) | 1677 | if (!memcmp(array_entry->vpd.vpd.sn, zero_sn, IPR_SERIAL_NUM_LEN)) |
@@ -2152,8 +2152,8 @@ static void ipr_log_sis64_array_error(struct ipr_ioa_cfg *ioa_cfg, | |||
2152 | ipr_err_separator; | 2152 | ipr_err_separator; |
2153 | 2153 | ||
2154 | array_entry = error->array_member; | 2154 | array_entry = error->array_member; |
2155 | num_entries = min_t(u32, be32_to_cpu(error->num_entries), | 2155 | num_entries = min_t(u32, error->num_entries, |
2156 | sizeof(error->array_member)); | 2156 | ARRAY_SIZE(error->array_member)); |
2157 | 2157 | ||
2158 | for (i = 0; i < num_entries; i++, array_entry++) { | 2158 | for (i = 0; i < num_entries; i++, array_entry++) { |
2159 | 2159 | ||
@@ -2167,10 +2167,10 @@ static void ipr_log_sis64_array_error(struct ipr_ioa_cfg *ioa_cfg, | |||
2167 | 2167 | ||
2168 | ipr_err("Array Member %d:\n", i); | 2168 | ipr_err("Array Member %d:\n", i); |
2169 | ipr_log_ext_vpd(&array_entry->vpd); | 2169 | ipr_log_ext_vpd(&array_entry->vpd); |
2170 | ipr_err("Current Location: %s", | 2170 | ipr_err("Current Location: %s\n", |
2171 | ipr_format_res_path(array_entry->res_path, buffer, | 2171 | ipr_format_res_path(array_entry->res_path, buffer, |
2172 | sizeof(buffer))); | 2172 | sizeof(buffer))); |
2173 | ipr_err("Expected Location: %s", | 2173 | ipr_err("Expected Location: %s\n", |
2174 | ipr_format_res_path(array_entry->expected_res_path, | 2174 | ipr_format_res_path(array_entry->expected_res_path, |
2175 | buffer, sizeof(buffer))); | 2175 | buffer, sizeof(buffer))); |
2176 | 2176 | ||
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h index 67cae67378ad..aa8bb2f2c6ee 100644 --- a/drivers/scsi/ipr.h +++ b/drivers/scsi/ipr.h | |||
@@ -319,6 +319,11 @@ struct ipr_ext_vpd { | |||
319 | __be32 wwid[2]; | 319 | __be32 wwid[2]; |
320 | }__attribute__((packed)); | 320 | }__attribute__((packed)); |
321 | 321 | ||
322 | struct ipr_ext_vpd64 { | ||
323 | struct ipr_vpd vpd; | ||
324 | __be32 wwid[4]; | ||
325 | }__attribute__((packed)); | ||
326 | |||
322 | struct ipr_std_inq_data { | 327 | struct ipr_std_inq_data { |
323 | u8 peri_qual_dev_type; | 328 | u8 peri_qual_dev_type; |
324 | #define IPR_STD_INQ_PERI_QUAL(peri) ((peri) >> 5) | 329 | #define IPR_STD_INQ_PERI_QUAL(peri) ((peri) >> 5) |
@@ -395,7 +400,7 @@ struct ipr_config_table_entry64 { | |||
395 | __be64 res_path; | 400 | __be64 res_path; |
396 | struct ipr_std_inq_data std_inq_data; | 401 | struct ipr_std_inq_data std_inq_data; |
397 | u8 reserved2[4]; | 402 | u8 reserved2[4]; |
398 | __be64 reserved3[2]; // description text | 403 | __be64 reserved3[2]; |
399 | u8 reserved4[8]; | 404 | u8 reserved4[8]; |
400 | }__attribute__ ((packed, aligned (8))); | 405 | }__attribute__ ((packed, aligned (8))); |
401 | 406 | ||
@@ -914,7 +919,7 @@ struct ipr_hostrcb_type_24_error { | |||
914 | u8 array_id; | 919 | u8 array_id; |
915 | u8 last_res_path[8]; | 920 | u8 last_res_path[8]; |
916 | u8 protection_level[8]; | 921 | u8 protection_level[8]; |
917 | struct ipr_ext_vpd array_vpd; | 922 | struct ipr_ext_vpd64 array_vpd; |
918 | u8 description[16]; | 923 | u8 description[16]; |
919 | u8 reserved2[3]; | 924 | u8 reserved2[3]; |
920 | u8 num_entries; | 925 | u8 num_entries; |