Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] ipr: Reduce default error log size

Since the default error log size has increased on SAS adapters,
prevent ipr from logging this additional data unless requested
to do so by the user set log level in order to prevent flooding
the logs.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>

authored by

Brian King and committed by
James Bottomley
ac719aba 49dc6a18

+10 -5
+9 -5
drivers/scsi/ipr.c
··· 1249 1249 1250 1250 /** 1251 1251 * ipr_log_hex_data - Log additional hex IOA error data. 1252 + * @ioa_cfg: ioa config struct 1252 1253 * @data: IOA error data 1253 1254 * @len: data length 1254 1255 * 1255 1256 * Return value: 1256 1257 * none 1257 1258 **/ 1258 - static void ipr_log_hex_data(u32 *data, int len) 1259 + static void ipr_log_hex_data(struct ipr_ioa_cfg *ioa_cfg, u32 *data, int len) 1259 1260 { 1260 1261 int i; 1261 1262 1262 1263 if (len == 0) 1263 1264 return; 1265 + 1266 + if (ioa_cfg->log_level <= IPR_DEFAULT_LOG_LEVEL) 1267 + len = min_t(int, len, IPR_DEFAULT_MAX_ERROR_DUMP); 1264 1268 1265 1269 for (i = 0; i < len / 4; i += 4) { 1266 1270 ipr_err("%08X: %08X %08X %08X %08X\n", i*4, ··· 1294 1290 ipr_err("%s\n", error->failure_reason); 1295 1291 ipr_err("Remote Adapter VPD:\n"); 1296 1292 ipr_log_ext_vpd(&error->vpd); 1297 - ipr_log_hex_data(error->data, 1293 + ipr_log_hex_data(ioa_cfg, error->data, 1298 1294 be32_to_cpu(hostrcb->hcam.length) - 1299 1295 (offsetof(struct ipr_hostrcb_error, u) + 1300 1296 offsetof(struct ipr_hostrcb_type_17_error, data))); ··· 1319 1315 ipr_err("%s\n", error->failure_reason); 1320 1316 ipr_err("Remote Adapter VPD:\n"); 1321 1317 ipr_log_vpd(&error->vpd); 1322 - ipr_log_hex_data(error->data, 1318 + ipr_log_hex_data(ioa_cfg, error->data, 1323 1319 be32_to_cpu(hostrcb->hcam.length) - 1324 1320 (offsetof(struct ipr_hostrcb_error, u) + 1325 1321 offsetof(struct ipr_hostrcb_type_07_error, data))); ··· 1535 1531 ((unsigned long)fabric + be16_to_cpu(fabric->length)); 1536 1532 } 1537 1533 1538 - ipr_log_hex_data((u32 *)fabric, add_len); 1534 + ipr_log_hex_data(ioa_cfg, (u32 *)fabric, add_len); 1539 1535 } 1540 1536 1541 1537 /** ··· 1549 1545 static void ipr_log_generic_error(struct ipr_ioa_cfg *ioa_cfg, 1550 1546 struct ipr_hostrcb *hostrcb) 1551 1547 { 1552 - ipr_log_hex_data(hostrcb->hcam.u.raw.data, 1548 + ipr_log_hex_data(ioa_cfg, hostrcb->hcam.u.raw.data, 1553 1549 be32_to_cpu(hostrcb->hcam.length)); 1554 1550 } 1555 1551
+1
drivers/scsi/ipr.h
··· 104 104 #define IPR_IOASC_IOA_WAS_RESET 0x10000001 105 105 #define IPR_IOASC_PCI_ACCESS_ERROR 0x10000002 106 106 107 + #define IPR_DEFAULT_MAX_ERROR_DUMP 984 107 108 #define IPR_NUM_LOG_HCAMS 2 108 109 #define IPR_NUM_CFG_CHG_HCAMS 2 109 110 #define IPR_NUM_HCAMS (IPR_NUM_LOG_HCAMS + IPR_NUM_CFG_CHG_HCAMS)