The patch titled scsi: fix sense key MEDIUM ERROR processing and retry has been added to the -mm tree. Its filename is fix-sense-key-medium-error-processing-and-retry.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: scsi: fix sense key MEDIUM ERROR processing and retry From: Luben Tuikov <ltuikov@xxxxxxxxx> - If the device reports an uncorrectable MEDIUM ERROR, such as SK MEDIUM ERROR, ASC UNRECOVERED READ ERR, AMNF DATA FIELD or RECORD NOT FOUND, then: In scsi_check_sense() return SUCCESS so as to not retry -- the error is uncorrectable -- this speeds up total processing time. - In scsi_io_completion(), retry if and only if there was at least one byte completed, i.e. good_bytes != 0. If good_bytes == 0, don't try to retry. Without this patch, SCSI Core gets hung reading sector 0 forever, for example when reading the partition table of a (newly discovered) device. Signed-off-by: Luben Tuikov <ltuikov@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/scsi/scsi_error.c | 5 +++++ drivers/scsi/scsi_lib.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff -puN drivers/scsi/scsi_error.c~fix-sense-key-medium-error-processing-and-retry drivers/scsi/scsi_error.c --- a/drivers/scsi/scsi_error.c~fix-sense-key-medium-error-processing-and-retry +++ a/drivers/scsi/scsi_error.c @@ -359,6 +359,11 @@ static int scsi_check_sense(struct scsi_ return SUCCESS; case MEDIUM_ERROR: + if (sshdr.asc == 0x11 || /* UNRECOVERED READ ERR */ + sshdr.asc == 0x13 || /* AMNF DATA FIELD */ + sshdr.asc == 0x14) { /* RECORD NOT FOUND */ + return SUCCESS; + } return NEEDS_RETRY; case HARDWARE_ERROR: diff -puN drivers/scsi/scsi_lib.c~fix-sense-key-medium-error-processing-and-retry drivers/scsi/scsi_lib.c --- a/drivers/scsi/scsi_lib.c~fix-sense-key-medium-error-processing-and-retry +++ a/drivers/scsi/scsi_lib.c @@ -871,7 +871,8 @@ void scsi_io_completion(struct scsi_cmnd * are leftovers and there is some kind of error * (result != 0), retry the rest. */ - if (scsi_end_request(cmd, 1, good_bytes, result == 0) == NULL) + if (good_bytes && + scsi_end_request(cmd, 1, good_bytes, result == 0) == NULL) return; /* good_bytes = 0, or (inclusive) there were leftovers and _ Patches currently in -mm which might be from ltuikov@xxxxxxxxx are git-scsi-misc.patch fix-sense-key-medium-error-processing-and-retry.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html