Commit f8c493c5 authored by Mike Anderson's avatar Mike Anderson Committed by James Bottomley

[PATCH] scsi_eh_flush_done_q return status

This patch fixes a bug in scsi_eh_flush_done_q when the allowed count has
been exceeded and the command errored for a timeout. The bug is that the
result will be left at zero and the command finished.

 patched-scsi-misc-2.7-andmike/drivers/scsi/scsi_error.c |   28 +++++++---------
 1 files changed, 13 insertions(+), 15 deletions(-)
parent 5f85fc98
...@@ -1420,23 +1420,21 @@ static void scsi_eh_flush_done_q(struct list_head *done_q) ...@@ -1420,23 +1420,21 @@ static void scsi_eh_flush_done_q(struct list_head *done_q)
list_for_each_safe(lh, lh_sf, done_q) { list_for_each_safe(lh, lh_sf, done_q) {
scmd = list_entry(lh, struct scsi_cmnd, eh_entry); scmd = list_entry(lh, struct scsi_cmnd, eh_entry);
list_del_init(lh); list_del_init(lh);
if (!scmd->device->online) { if (scmd->device->online &&
scmd->result |= (DRIVER_TIMEOUT << 24); (++scmd->retries < scmd->allowed)) {
} else { SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush"
if (++scmd->retries < scmd->allowed) { " retry cmd: %p\n",
SCSI_LOG_ERROR_RECOVERY(3, current->comm,
printk("%s: flush retry" scmd));
" cmd: %p\n",
current->comm,
scmd));
scsi_queue_insert(scmd, SCSI_MLQUEUE_EH_RETRY); scsi_queue_insert(scmd, SCSI_MLQUEUE_EH_RETRY);
continue; } else {
} if (!scmd->result)
scmd->result |= (DRIVER_TIMEOUT << 24);
SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush finish"
" cmd: %p\n",
current->comm, scmd));
scsi_finish_command(scmd);
} }
SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush finish"
" cmd: %p\n",
current->comm, 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