[PATCH] fix "scsi: aic7xxx hang since v2.6.28-rc1", v2

From: Ingo Molnar
Date: Tue Mar 03 2009 - 15:52:16 EST


updated "SCSI: remove scsi_end_request()" patch.

Signed-off-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
---
drivers/scsi/scsi_lib.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 8388b4e..abd2652 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -916,12 +916,11 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
req->nr_sectors, good_bytes));
if (blk_end_request(req, error, good_bytes) == 0) {
/* This request is completely finished; start the next one */
+ __scsi_release_buffers(cmd, 0);
scsi_next_command(cmd);
return;
}

- error = -EIO;
-
/* The request isn't finished yet. Figure out what to do next. */
if (result == 0) {
/* No error, so carry out the remainder of the request.
@@ -931,8 +930,9 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
if (good_bytes > 0 || --req->retries >= 0)
action = ACTION_REPREP;
else {
- action = ACTION_FAIL;
description = "Retries exhausted";
+ action = ACTION_FAIL;
+ error = -EIO;
}
} else if (error && scsi_noretry_cmd(cmd)) {
/* Retrys are disallowed, so kill the remainder. */
@@ -944,6 +944,7 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
*/
action = ACTION_RETRY;
} else if (sense_valid && !sense_deferred) {
+ error = -EIO;
switch (sshdr.sense_key) {
case UNIT_ATTENTION:
if (cmd->device->removable) {
@@ -1043,7 +1044,7 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
if (driver_byte(result) & DRIVER_SENSE)
scsi_print_sense("", cmd);
}
- blk_end_request(req, -EIO, blk_rq_bytes(req));
+ blk_end_request(req, error, blk_rq_bytes(req));
scsi_next_command(cmd);
break;
case ACTION_REPREP:
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/