Commit 470613b4 authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Christoph Hellwig

scsi: do not display kernel pointer in message logs

It is not good practice to display the kernel pointer in any message logs,
and it doesn't display any additional information. And as we know have
block-layer assigned tags we can use them to differentiate the messages.
So remove any pointer references from the displayed messages.
Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent a4a6afb4
...@@ -124,41 +124,37 @@ scmd_eh_abort_handler(struct work_struct *work) ...@@ -124,41 +124,37 @@ scmd_eh_abort_handler(struct work_struct *work)
if (scsi_host_eh_past_deadline(sdev->host)) { if (scsi_host_eh_past_deadline(sdev->host)) {
SCSI_LOG_ERROR_RECOVERY(3, SCSI_LOG_ERROR_RECOVERY(3,
scmd_printk(KERN_INFO, scmd, scmd_printk(KERN_INFO, scmd,
"scmd %p eh timeout, not aborting\n", "eh timeout, not aborting\n"));
scmd));
} else { } else {
SCSI_LOG_ERROR_RECOVERY(3, SCSI_LOG_ERROR_RECOVERY(3,
scmd_printk(KERN_INFO, scmd, scmd_printk(KERN_INFO, scmd,
"aborting command %p\n", scmd)); "aborting command\n"));
rtn = scsi_try_to_abort_cmd(sdev->host->hostt, scmd); rtn = scsi_try_to_abort_cmd(sdev->host->hostt, scmd);
if (rtn == SUCCESS) { if (rtn == SUCCESS) {
set_host_byte(scmd, DID_TIME_OUT); set_host_byte(scmd, DID_TIME_OUT);
if (scsi_host_eh_past_deadline(sdev->host)) { if (scsi_host_eh_past_deadline(sdev->host)) {
SCSI_LOG_ERROR_RECOVERY(3, SCSI_LOG_ERROR_RECOVERY(3,
scmd_printk(KERN_INFO, scmd, scmd_printk(KERN_INFO, scmd,
"scmd %p eh timeout, " "eh timeout, not retrying "
"not retrying aborted " "aborted command\n"));
"command\n", scmd));
} else if (!scsi_noretry_cmd(scmd) && } else if (!scsi_noretry_cmd(scmd) &&
(++scmd->retries <= scmd->allowed)) { (++scmd->retries <= scmd->allowed)) {
SCSI_LOG_ERROR_RECOVERY(3, SCSI_LOG_ERROR_RECOVERY(3,
scmd_printk(KERN_WARNING, scmd, scmd_printk(KERN_WARNING, scmd,
"scmd %p retry " "retry aborted command\n"));
"aborted command\n", scmd));
scsi_queue_insert(scmd, SCSI_MLQUEUE_EH_RETRY); scsi_queue_insert(scmd, SCSI_MLQUEUE_EH_RETRY);
return; return;
} else { } else {
SCSI_LOG_ERROR_RECOVERY(3, SCSI_LOG_ERROR_RECOVERY(3,
scmd_printk(KERN_WARNING, scmd, scmd_printk(KERN_WARNING, scmd,
"scmd %p finish " "finish aborted command\n"));
"aborted command\n", scmd));
scsi_finish_command(scmd); scsi_finish_command(scmd);
return; return;
} }
} else { } else {
SCSI_LOG_ERROR_RECOVERY(3, SCSI_LOG_ERROR_RECOVERY(3,
scmd_printk(KERN_INFO, scmd, scmd_printk(KERN_INFO, scmd,
"scmd %p abort %s\n", scmd, "cmd abort %s\n",
(rtn == FAST_IO_FAIL) ? (rtn == FAST_IO_FAIL) ?
"not send" : "failed")); "not send" : "failed"));
} }
...@@ -167,8 +163,7 @@ scmd_eh_abort_handler(struct work_struct *work) ...@@ -167,8 +163,7 @@ scmd_eh_abort_handler(struct work_struct *work)
if (!scsi_eh_scmd_add(scmd, 0)) { if (!scsi_eh_scmd_add(scmd, 0)) {
SCSI_LOG_ERROR_RECOVERY(3, SCSI_LOG_ERROR_RECOVERY(3,
scmd_printk(KERN_WARNING, scmd, scmd_printk(KERN_WARNING, scmd,
"scmd %p terminate " "terminate aborted command\n"));
"aborted command\n", scmd));
set_host_byte(scmd, DID_TIME_OUT); set_host_byte(scmd, DID_TIME_OUT);
scsi_finish_command(scmd); scsi_finish_command(scmd);
} }
...@@ -194,7 +189,7 @@ scsi_abort_command(struct scsi_cmnd *scmd) ...@@ -194,7 +189,7 @@ scsi_abort_command(struct scsi_cmnd *scmd)
scmd->eh_eflags &= ~SCSI_EH_ABORT_SCHEDULED; scmd->eh_eflags &= ~SCSI_EH_ABORT_SCHEDULED;
SCSI_LOG_ERROR_RECOVERY(3, SCSI_LOG_ERROR_RECOVERY(3,
scmd_printk(KERN_INFO, scmd, scmd_printk(KERN_INFO, scmd,
"scmd %p previous abort failed\n", scmd)); "previous abort failed\n"));
BUG_ON(delayed_work_pending(&scmd->abort_work)); BUG_ON(delayed_work_pending(&scmd->abort_work));
return FAILED; return FAILED;
} }
...@@ -208,8 +203,7 @@ scsi_abort_command(struct scsi_cmnd *scmd) ...@@ -208,8 +203,7 @@ scsi_abort_command(struct scsi_cmnd *scmd)
spin_unlock_irqrestore(shost->host_lock, flags); spin_unlock_irqrestore(shost->host_lock, flags);
SCSI_LOG_ERROR_RECOVERY(3, SCSI_LOG_ERROR_RECOVERY(3,
scmd_printk(KERN_INFO, scmd, scmd_printk(KERN_INFO, scmd,
"scmd %p not aborting, host in recovery\n", "not aborting, host in recovery\n"));
scmd));
return FAILED; return FAILED;
} }
...@@ -219,8 +213,7 @@ scsi_abort_command(struct scsi_cmnd *scmd) ...@@ -219,8 +213,7 @@ scsi_abort_command(struct scsi_cmnd *scmd)
scmd->eh_eflags |= SCSI_EH_ABORT_SCHEDULED; scmd->eh_eflags |= SCSI_EH_ABORT_SCHEDULED;
SCSI_LOG_ERROR_RECOVERY(3, SCSI_LOG_ERROR_RECOVERY(3,
scmd_printk(KERN_INFO, scmd, scmd_printk(KERN_INFO, scmd, "abort scheduled\n"));
"scmd %p abort scheduled\n", scmd));
queue_delayed_work(shost->tmf_work_q, &scmd->abort_work, HZ / 100); queue_delayed_work(shost->tmf_work_q, &scmd->abort_work, HZ / 100);
return SUCCESS; return SUCCESS;
} }
...@@ -737,8 +730,7 @@ static void scsi_eh_done(struct scsi_cmnd *scmd) ...@@ -737,8 +730,7 @@ static void scsi_eh_done(struct scsi_cmnd *scmd)
struct completion *eh_action; struct completion *eh_action;
SCSI_LOG_ERROR_RECOVERY(3, scmd_printk(KERN_INFO, scmd, SCSI_LOG_ERROR_RECOVERY(3, scmd_printk(KERN_INFO, scmd,
"%s scmd: %p result: %x\n", "%s result: %x\n", __func__, scmd->result));
__func__, scmd, scmd->result));
eh_action = scmd->device->host->eh_action; eh_action = scmd->device->host->eh_action;
if (eh_action) if (eh_action)
...@@ -1053,8 +1045,8 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd, ...@@ -1053,8 +1045,8 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd,
scsi_log_completion(scmd, rtn); scsi_log_completion(scmd, rtn);
SCSI_LOG_ERROR_RECOVERY(3, scmd_printk(KERN_INFO, scmd, SCSI_LOG_ERROR_RECOVERY(3, scmd_printk(KERN_INFO, scmd,
"%s: scmd: %p, timeleft: %ld\n", "%s timeleft: %ld\n",
__func__, scmd, timeleft)); __func__, timeleft));
/* /*
* If there is time left scsi_eh_done got called, and we will examine * If there is time left scsi_eh_done got called, and we will examine
...@@ -1193,8 +1185,7 @@ int scsi_eh_get_sense(struct list_head *work_q, ...@@ -1193,8 +1185,7 @@ int scsi_eh_get_sense(struct list_head *work_q,
continue; continue;
SCSI_LOG_ERROR_RECOVERY(3, scmd_printk(KERN_INFO, scmd, SCSI_LOG_ERROR_RECOVERY(3, scmd_printk(KERN_INFO, scmd,
"sense requested for %p result %x\n", "sense requested, result %x\n", scmd->result));
scmd, scmd->result));
SCSI_LOG_ERROR_RECOVERY(3, scsi_print_sense(scmd)); SCSI_LOG_ERROR_RECOVERY(3, scsi_print_sense(scmd));
rtn = scsi_decide_disposition(scmd); rtn = scsi_decide_disposition(scmd);
...@@ -1236,7 +1227,7 @@ static int scsi_eh_tur(struct scsi_cmnd *scmd) ...@@ -1236,7 +1227,7 @@ static int scsi_eh_tur(struct scsi_cmnd *scmd)
scmd->device->eh_timeout, 0); scmd->device->eh_timeout, 0);
SCSI_LOG_ERROR_RECOVERY(3, scmd_printk(KERN_INFO, scmd, SCSI_LOG_ERROR_RECOVERY(3, scmd_printk(KERN_INFO, scmd,
"%s: scmd %p rtn %x\n", __func__, scmd, rtn)); "%s return: %x\n", __func__, rtn));
switch (rtn) { switch (rtn) {
case NEEDS_RETRY: case NEEDS_RETRY:
...@@ -2093,8 +2084,8 @@ void scsi_eh_flush_done_q(struct list_head *done_q) ...@@ -2093,8 +2084,8 @@ void scsi_eh_flush_done_q(struct list_head *done_q)
(++scmd->retries <= scmd->allowed)) { (++scmd->retries <= scmd->allowed)) {
SCSI_LOG_ERROR_RECOVERY(3, SCSI_LOG_ERROR_RECOVERY(3,
scmd_printk(KERN_INFO, scmd, scmd_printk(KERN_INFO, scmd,
"%s: flush retry cmd: %p\n", "%s: flush retry cmd\n",
current->comm, scmd)); current->comm));
scsi_queue_insert(scmd, SCSI_MLQUEUE_EH_RETRY); scsi_queue_insert(scmd, SCSI_MLQUEUE_EH_RETRY);
} else { } else {
/* /*
...@@ -2106,8 +2097,8 @@ void scsi_eh_flush_done_q(struct list_head *done_q) ...@@ -2106,8 +2097,8 @@ void scsi_eh_flush_done_q(struct list_head *done_q)
scmd->result |= (DRIVER_TIMEOUT << 24); scmd->result |= (DRIVER_TIMEOUT << 24);
SCSI_LOG_ERROR_RECOVERY(3, SCSI_LOG_ERROR_RECOVERY(3,
scmd_printk(KERN_INFO, scmd, scmd_printk(KERN_INFO, scmd,
"%s: flush finish cmd: %p\n", "%s: flush finish cmd\n",
current->comm, scmd)); current->comm));
scsi_finish_command(scmd); scsi_finish_command(scmd);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment