* [PATCH 1/1] ipr: fix array error logging [not found] <20100927165904.645771561@linux.vnet.ibm.com> @ 2010-09-27 17:05 ` Wayne Boyer 2010-09-27 17:45 ` Wayne Boyer 0 siblings, 1 reply; 3+ messages in thread From: Wayne Boyer @ 2010-09-27 17:05 UTC (permalink / raw) To: James Bottomley; +Cc: linux-scsi, Brian King, Kleber Sacilotto de Souza 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> --- drivers/scsi/ipr.c | 10 +++++----- drivers/scsi/ipr.h | 9 +++++++-- 2 files changed, 12 insertions(+), 7 deletions(-) Index: b/drivers/scsi/ipr.c =================================================================== --- a/drivers/scsi/ipr.c 2010-09-23 09:33:27.000000000 -0700 +++ b/drivers/scsi/ipr.c 2010-09-27 08:44:11.000000000 -0700 @@ -1671,7 +1671,7 @@ static void ipr_log_enhanced_array_error array_entry = error->array_member; num_entries = min_t(u32, be32_to_cpu(error->num_entries), - sizeof(error->array_member)); + ARRAY_SIZE(error->array_member)); for (i = 0; i < num_entries; i++, array_entry++) { if (!memcmp(array_entry->vpd.vpd.sn, zero_sn, IPR_SERIAL_NUM_LEN)) @@ -2152,8 +2152,8 @@ static void ipr_log_sis64_array_error(st ipr_err_separator; array_entry = error->array_member; - num_entries = min_t(u32, be32_to_cpu(error->num_entries), - sizeof(error->array_member)); + num_entries = min_t(u32, error->num_entries, + ARRAY_SIZE(error->array_member); for (i = 0; i < num_entries; i++, array_entry++) { @@ -2167,10 +2167,10 @@ static void ipr_log_sis64_array_error(st ipr_err("Array Member %d:\n", i); ipr_log_ext_vpd(&array_entry->vpd); - ipr_err("Current Location: %s", + ipr_err("Current Location: %s\n", ipr_format_res_path(array_entry->res_path, buffer, sizeof(buffer))); - ipr_err("Expected Location: %s", + ipr_err("Expected Location: %s\n", ipr_format_res_path(array_entry->expected_res_path, buffer, sizeof(buffer))); Index: b/drivers/scsi/ipr.h =================================================================== --- a/drivers/scsi/ipr.h 2010-09-23 09:33:29.000000000 -0700 +++ b/drivers/scsi/ipr.h 2010-09-23 12:03:59.000000000 -0700 @@ -319,6 +319,11 @@ struct ipr_ext_vpd { __be32 wwid[2]; }__attribute__((packed)); +struct ipr_ext_vpd64 { + struct ipr_vpd vpd; + __be32 wwid[4]; +}__attribute__((packed)); + struct ipr_std_inq_data { u8 peri_qual_dev_type; #define IPR_STD_INQ_PERI_QUAL(peri) ((peri) >> 5) @@ -395,7 +400,7 @@ struct ipr_config_table_entry64 { __be64 res_path; struct ipr_std_inq_data std_inq_data; u8 reserved2[4]; - __be64 reserved3[2]; // description text + __be64 reserved3[2]; u8 reserved4[8]; }__attribute__ ((packed, aligned (8))); @@ -914,7 +919,7 @@ struct ipr_hostrcb_type_24_error { u8 array_id; u8 last_res_path[8]; u8 protection_level[8]; - struct ipr_ext_vpd array_vpd; + struct ipr_ext_vpd64 array_vpd; u8 description[16]; u8 reserved2[3]; u8 num_entries; ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] ipr: fix array error logging 2010-09-27 17:05 ` [PATCH 1/1] ipr: fix array error logging Wayne Boyer @ 2010-09-27 17:45 ` Wayne Boyer 2010-09-30 15:44 ` Brian King 0 siblings, 1 reply; 3+ messages in thread From: Wayne Boyer @ 2010-09-27 17:45 UTC (permalink / raw) To: James Bottomley; +Cc: linux-scsi, Brian King, Kleber Sacilotto de Souza The original patch was broken. Here's the correct patch. --- 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> --- drivers/scsi/ipr.c | 10 +++++----- drivers/scsi/ipr.h | 9 +++++++-- 2 files changed, 12 insertions(+), 7 deletions(-) Index: b/drivers/scsi/ipr.c =================================================================== --- a/drivers/scsi/ipr.c 2010-09-23 09:33:27.000000000 -0700 +++ b/drivers/scsi/ipr.c 2010-09-27 10:43:00.000000000 -0700 @@ -1671,7 +1671,7 @@ static void ipr_log_enhanced_array_error array_entry = error->array_member; num_entries = min_t(u32, be32_to_cpu(error->num_entries), - sizeof(error->array_member)); + ARRAY_SIZE(error->array_member)); for (i = 0; i < num_entries; i++, array_entry++) { if (!memcmp(array_entry->vpd.vpd.sn, zero_sn, IPR_SERIAL_NUM_LEN)) @@ -2152,8 +2152,8 @@ static void ipr_log_sis64_array_error(st ipr_err_separator; array_entry = error->array_member; - num_entries = min_t(u32, be32_to_cpu(error->num_entries), - sizeof(error->array_member)); + num_entries = min_t(u32, error->num_entries, + ARRAY_SIZE(error->array_member)); for (i = 0; i < num_entries; i++, array_entry++) { @@ -2167,10 +2167,10 @@ static void ipr_log_sis64_array_error(st ipr_err("Array Member %d:\n", i); ipr_log_ext_vpd(&array_entry->vpd); - ipr_err("Current Location: %s", + ipr_err("Current Location: %s\n", ipr_format_res_path(array_entry->res_path, buffer, sizeof(buffer))); - ipr_err("Expected Location: %s", + ipr_err("Expected Location: %s\n", ipr_format_res_path(array_entry->expected_res_path, buffer, sizeof(buffer))); Index: b/drivers/scsi/ipr.h =================================================================== --- a/drivers/scsi/ipr.h 2010-09-23 09:33:29.000000000 -0700 +++ b/drivers/scsi/ipr.h 2010-09-23 12:03:59.000000000 -0700 @@ -319,6 +319,11 @@ struct ipr_ext_vpd { __be32 wwid[2]; }__attribute__((packed)); +struct ipr_ext_vpd64 { + struct ipr_vpd vpd; + __be32 wwid[4]; +}__attribute__((packed)); + struct ipr_std_inq_data { u8 peri_qual_dev_type; #define IPR_STD_INQ_PERI_QUAL(peri) ((peri) >> 5) @@ -395,7 +400,7 @@ struct ipr_config_table_entry64 { __be64 res_path; struct ipr_std_inq_data std_inq_data; u8 reserved2[4]; - __be64 reserved3[2]; // description text + __be64 reserved3[2]; u8 reserved4[8]; }__attribute__ ((packed, aligned (8))); @@ -914,7 +919,7 @@ struct ipr_hostrcb_type_24_error { u8 array_id; u8 last_res_path[8]; u8 protection_level[8]; - struct ipr_ext_vpd array_vpd; + struct ipr_ext_vpd64 array_vpd; u8 description[16]; u8 reserved2[3]; u8 num_entries; ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] ipr: fix array error logging 2010-09-27 17:45 ` Wayne Boyer @ 2010-09-30 15:44 ` Brian King 0 siblings, 0 replies; 3+ messages in thread From: Brian King @ 2010-09-30 15:44 UTC (permalink / raw) To: Wayne Boyer; +Cc: James Bottomley, linux-scsi, Kleber Sacilotto de Souza On 09/27/2010 12:45 PM, Wayne Boyer wrote: > The original patch was broken. Here's the correct patch. > > --- > > 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> -- Brian King Linux on Power Virtualization IBM Linux Technology Center ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-09-30 15:44 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <20100927165904.645771561@linux.vnet.ibm.com> 2010-09-27 17:05 ` [PATCH 1/1] ipr: fix array error logging Wayne Boyer 2010-09-27 17:45 ` Wayne Boyer 2010-09-30 15:44 ` Brian King
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).