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,24 +1420,22 @@ static void scsi_eh_flush_done_q(struct list_head *done_q)
list_for_each_safe(lh, lh_sf, done_q) {
scmd = list_entry(lh, struct scsi_cmnd, eh_entry);
list_del_init(lh);
if (!scmd->device->online) {
scmd->result |= (DRIVER_TIMEOUT << 24);
} else {
if (++scmd->retries < scmd->allowed) {
SCSI_LOG_ERROR_RECOVERY(3,
printk("%s: flush retry"
" cmd: %p\n",
if (scmd->device->online &&
(++scmd->retries < scmd->allowed)) {
SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush"
" retry cmd: %p\n",
current->comm,
scmd));
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);
}
}
}
/**
......
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