aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_error.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2014-10-24 08:27:02 -0400
committerChristoph Hellwig <hch@lst.de>2014-11-12 05:16:06 -0500
commita222b1e2fe4299a01c86ea8ccafbf0a05aeaa5a1 (patch)
tree97e962425ba693e38c101214b6f4cdbd1fefdad9 /drivers/scsi/scsi_error.c
parentc11c004b1c052fae77d3d0d14462d1f3a4e88d06 (diff)
scsi: fixup logging messages in scsi_error.c
Use the matching scope for logging messages to allow for better command tracing. Signed-off-by: Hannes Reinecke <hare@suse.de> Suggested-by: Robert Elliott <elliott@hp.com> Reviewed-by: Robert Elliott <elliott@hp.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/scsi_error.c')
-rw-r--r--drivers/scsi/scsi_error.c77
1 files changed, 37 insertions, 40 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index ab570f5cb6bb..c2bef46e90e0 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -1156,9 +1156,9 @@ int scsi_eh_get_sense(struct list_head *work_q,
1156 shost = scmd->device->host; 1156 shost = scmd->device->host;
1157 if (scsi_host_eh_past_deadline(shost)) { 1157 if (scsi_host_eh_past_deadline(shost)) {
1158 SCSI_LOG_ERROR_RECOVERY(3, 1158 SCSI_LOG_ERROR_RECOVERY(3,
1159 shost_printk(KERN_INFO, shost, 1159 scmd_printk(KERN_INFO, scmd,
1160 "skip %s, past eh deadline\n", 1160 "%s: skip request sense, past eh deadline\n",
1161 __func__)); 1161 current->comm));
1162 break; 1162 break;
1163 } 1163 }
1164 if (status_byte(scmd->result) != CHECK_CONDITION) 1164 if (status_byte(scmd->result) != CHECK_CONDITION)
@@ -1265,9 +1265,9 @@ static int scsi_eh_test_devices(struct list_head *cmd_list,
1265 /* Push items back onto work_q */ 1265 /* Push items back onto work_q */
1266 list_splice_init(cmd_list, work_q); 1266 list_splice_init(cmd_list, work_q);
1267 SCSI_LOG_ERROR_RECOVERY(3, 1267 SCSI_LOG_ERROR_RECOVERY(3,
1268 shost_printk(KERN_INFO, sdev->host, 1268 sdev_printk(KERN_INFO, sdev,
1269 "skip %s, past eh deadline", 1269 "%s: skip test device, past eh deadline",
1270 __func__)); 1270 current->comm));
1271 break; 1271 break;
1272 } 1272 }
1273 } 1273 }
@@ -1318,21 +1318,20 @@ static int scsi_eh_abort_cmds(struct list_head *work_q,
1318 if (scsi_host_eh_past_deadline(shost)) { 1318 if (scsi_host_eh_past_deadline(shost)) {
1319 list_splice_init(&check_list, work_q); 1319 list_splice_init(&check_list, work_q);
1320 SCSI_LOG_ERROR_RECOVERY(3, 1320 SCSI_LOG_ERROR_RECOVERY(3,
1321 shost_printk(KERN_INFO, shost, 1321 scmd_printk(KERN_INFO, scmd,
1322 "skip %s, past eh deadline\n", 1322 "%s: skip aborting cmd, past eh deadline\n",
1323 __func__)); 1323 current->comm));
1324 return list_empty(work_q); 1324 return list_empty(work_q);
1325 } 1325 }
1326 SCSI_LOG_ERROR_RECOVERY(3, 1326 SCSI_LOG_ERROR_RECOVERY(3,
1327 shost_printk(KERN_INFO, shost, 1327 scmd_printk(KERN_INFO, scmd,
1328 "%s: aborting cmd: 0x%p\n", 1328 "%s: aborting cmd\n", current->comm));
1329 current->comm, scmd));
1330 rtn = scsi_try_to_abort_cmd(shost->hostt, scmd); 1329 rtn = scsi_try_to_abort_cmd(shost->hostt, scmd);
1331 if (rtn == FAILED) { 1330 if (rtn == FAILED) {
1332 SCSI_LOG_ERROR_RECOVERY(3, 1331 SCSI_LOG_ERROR_RECOVERY(3,
1333 shost_printk(KERN_INFO, shost, 1332 scmd_printk(KERN_INFO, scmd,
1334 "%s: aborting cmd failed: 0x%p\n", 1333 "%s: aborting cmd failed\n",
1335 current->comm, scmd)); 1334 current->comm));
1336 list_splice_init(&check_list, work_q); 1335 list_splice_init(&check_list, work_q);
1337 return list_empty(work_q); 1336 return list_empty(work_q);
1338 } 1337 }
@@ -1390,9 +1389,9 @@ static int scsi_eh_stu(struct Scsi_Host *shost,
1390 shost_for_each_device(sdev, shost) { 1389 shost_for_each_device(sdev, shost) {
1391 if (scsi_host_eh_past_deadline(shost)) { 1390 if (scsi_host_eh_past_deadline(shost)) {
1392 SCSI_LOG_ERROR_RECOVERY(3, 1391 SCSI_LOG_ERROR_RECOVERY(3,
1393 shost_printk(KERN_INFO, shost, 1392 sdev_printk(KERN_INFO, sdev,
1394 "skip %s, past eh deadline\n", 1393 "%s: skip START_UNIT, past eh deadline\n",
1395 __func__)); 1394 current->comm));
1396 break; 1395 break;
1397 } 1396 }
1398 stu_scmd = NULL; 1397 stu_scmd = NULL;
@@ -1407,9 +1406,9 @@ static int scsi_eh_stu(struct Scsi_Host *shost,
1407 continue; 1406 continue;
1408 1407
1409 SCSI_LOG_ERROR_RECOVERY(3, 1408 SCSI_LOG_ERROR_RECOVERY(3,
1410 shost_printk(KERN_INFO, shost, 1409 sdev_printk(KERN_INFO, sdev,
1411 "%s: Sending START_UNIT to sdev: 0x%p\n", 1410 "%s: Sending START_UNIT\n",
1412 current->comm, sdev)); 1411 current->comm));
1413 1412
1414 if (!scsi_eh_try_stu(stu_scmd)) { 1413 if (!scsi_eh_try_stu(stu_scmd)) {
1415 if (!scsi_device_online(sdev) || 1414 if (!scsi_device_online(sdev) ||
@@ -1423,9 +1422,9 @@ static int scsi_eh_stu(struct Scsi_Host *shost,
1423 } 1422 }
1424 } else { 1423 } else {
1425 SCSI_LOG_ERROR_RECOVERY(3, 1424 SCSI_LOG_ERROR_RECOVERY(3,
1426 shost_printk(KERN_INFO, shost, 1425 sdev_printk(KERN_INFO, sdev,
1427 "%s: START_UNIT failed to sdev:" 1426 "%s: START_UNIT failed\n",
1428 " 0x%p\n", current->comm, sdev)); 1427 current->comm));
1429 } 1428 }
1430 } 1429 }
1431 1430
@@ -1456,9 +1455,9 @@ static int scsi_eh_bus_device_reset(struct Scsi_Host *shost,
1456 shost_for_each_device(sdev, shost) { 1455 shost_for_each_device(sdev, shost) {
1457 if (scsi_host_eh_past_deadline(shost)) { 1456 if (scsi_host_eh_past_deadline(shost)) {
1458 SCSI_LOG_ERROR_RECOVERY(3, 1457 SCSI_LOG_ERROR_RECOVERY(3,
1459 shost_printk(KERN_INFO, shost, 1458 sdev_printk(KERN_INFO, sdev,
1460 "skip %s, past eh deadline\n", 1459 "%s: skip BDR, past eh deadline\n",
1461 __func__)); 1460 current->comm));
1462 break; 1461 break;
1463 } 1462 }
1464 bdr_scmd = NULL; 1463 bdr_scmd = NULL;
@@ -1472,9 +1471,8 @@ static int scsi_eh_bus_device_reset(struct Scsi_Host *shost,
1472 continue; 1471 continue;
1473 1472
1474 SCSI_LOG_ERROR_RECOVERY(3, 1473 SCSI_LOG_ERROR_RECOVERY(3,
1475 shost_printk(KERN_INFO, shost, 1474 sdev_printk(KERN_INFO, sdev,
1476 "%s: Sending BDR sdev: 0x%p\n", 1475 "%s: Sending BDR\n", current->comm));
1477 current->comm, sdev));
1478 rtn = scsi_try_bus_device_reset(bdr_scmd); 1476 rtn = scsi_try_bus_device_reset(bdr_scmd);
1479 if (rtn == SUCCESS || rtn == FAST_IO_FAIL) { 1477 if (rtn == SUCCESS || rtn == FAST_IO_FAIL) {
1480 if (!scsi_device_online(sdev) || 1478 if (!scsi_device_online(sdev) ||
@@ -1490,9 +1488,8 @@ static int scsi_eh_bus_device_reset(struct Scsi_Host *shost,
1490 } 1488 }
1491 } else { 1489 } else {
1492 SCSI_LOG_ERROR_RECOVERY(3, 1490 SCSI_LOG_ERROR_RECOVERY(3,
1493 shost_printk(KERN_INFO, shost, 1491 sdev_printk(KERN_INFO, sdev,
1494 "%s: BDR failed sdev: 0x%p\n", 1492 "%s: BDR failed\n", current->comm));
1495 current->comm, sdev));
1496 } 1493 }
1497 } 1494 }
1498 1495
@@ -1528,8 +1525,8 @@ static int scsi_eh_target_reset(struct Scsi_Host *shost,
1528 list_splice_init(&tmp_list, work_q); 1525 list_splice_init(&tmp_list, work_q);
1529 SCSI_LOG_ERROR_RECOVERY(3, 1526 SCSI_LOG_ERROR_RECOVERY(3,
1530 shost_printk(KERN_INFO, shost, 1527 shost_printk(KERN_INFO, shost,
1531 "skip %s, past eh deadline\n", 1528 "%s: Skip target reset, past eh deadline\n",
1532 __func__)); 1529 current->comm));
1533 return list_empty(work_q); 1530 return list_empty(work_q);
1534 } 1531 }
1535 1532
@@ -1591,8 +1588,8 @@ static int scsi_eh_bus_reset(struct Scsi_Host *shost,
1591 list_splice_init(&check_list, work_q); 1588 list_splice_init(&check_list, work_q);
1592 SCSI_LOG_ERROR_RECOVERY(3, 1589 SCSI_LOG_ERROR_RECOVERY(3,
1593 shost_printk(KERN_INFO, shost, 1590 shost_printk(KERN_INFO, shost,
1594 "skip %s, past eh deadline\n", 1591 "%s: skip BRST, past eh deadline\n",
1595 __func__)); 1592 current->comm));
1596 return list_empty(work_q); 1593 return list_empty(work_q);
1597 } 1594 }
1598 1595
@@ -2193,9 +2190,9 @@ int scsi_error_handler(void *data)
2193 */ 2190 */
2194 if (!shost->eh_noresume && scsi_autopm_get_host(shost) != 0) { 2191 if (!shost->eh_noresume && scsi_autopm_get_host(shost) != 0) {
2195 SCSI_LOG_ERROR_RECOVERY(1, 2192 SCSI_LOG_ERROR_RECOVERY(1,
2196 printk(KERN_ERR "Error handler scsi_eh_%d " 2193 shost_printk(KERN_ERR, shost,
2197 "unable to autoresume\n", 2194 "scsi_eh_%d: unable to autoresume\n",
2198 shost->host_no)); 2195 shost->host_no));
2199 continue; 2196 continue;
2200 } 2197 }
2201 2198