diff options
-rw-r--r-- | drivers/scsi/scsi_lib.c | 17 | ||||
-rw-r--r-- | drivers/scsi/sd.c | 6 | ||||
-rw-r--r-- | drivers/scsi/sr.c | 9 |
3 files changed, 16 insertions, 16 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 4b13e36d3aa0..d1cb64ad1a3f 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -791,7 +791,22 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) | |||
791 | "%d bytes done.\n", | 791 | "%d bytes done.\n", |
792 | req->nr_sectors, good_bytes)); | 792 | req->nr_sectors, good_bytes)); |
793 | 793 | ||
794 | /* A number of bytes were successfully read. If there | 794 | /* |
795 | * Recovered errors need reporting, but they're always treated | ||
796 | * as success, so fiddle the result code here. For BLOCK_PC | ||
797 | * we already took a copy of the original into rq->errors which | ||
798 | * is what gets returned to the user | ||
799 | */ | ||
800 | if (sense_valid && sshdr.sense_key == RECOVERED_ERROR) { | ||
801 | if (!(req->cmd_flags & REQ_QUIET)) | ||
802 | scsi_print_sense("", cmd); | ||
803 | result = 0; | ||
804 | /* BLOCK_PC may have set error */ | ||
805 | error = 0; | ||
806 | } | ||
807 | |||
808 | /* | ||
809 | * A number of bytes were successfully read. If there | ||
795 | * are leftovers and there is some kind of error | 810 | * are leftovers and there is some kind of error |
796 | * (result != 0), retry the rest. | 811 | * (result != 0), retry the rest. |
797 | */ | 812 | */ |
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index aeab5d9dff27..3fcb64b91c43 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -1051,12 +1051,6 @@ static int sd_done(struct scsi_cmnd *SCpnt) | |||
1051 | good_bytes = sd_completed_bytes(SCpnt); | 1051 | good_bytes = sd_completed_bytes(SCpnt); |
1052 | break; | 1052 | break; |
1053 | case RECOVERED_ERROR: | 1053 | case RECOVERED_ERROR: |
1054 | /* Inform the user, but make sure that it's not treated | ||
1055 | * as a hard error. | ||
1056 | */ | ||
1057 | scsi_print_sense("sd", SCpnt); | ||
1058 | SCpnt->result = 0; | ||
1059 | memset(SCpnt->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); | ||
1060 | good_bytes = scsi_bufflen(SCpnt); | 1054 | good_bytes = scsi_bufflen(SCpnt); |
1061 | break; | 1055 | break; |
1062 | case NO_SENSE: | 1056 | case NO_SENSE: |
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index e7fa3caead79..0e1a0f2d2ad5 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c | |||
@@ -309,15 +309,6 @@ static int sr_done(struct scsi_cmnd *SCpnt) | |||
309 | break; | 309 | break; |
310 | 310 | ||
311 | case RECOVERED_ERROR: | 311 | case RECOVERED_ERROR: |
312 | |||
313 | /* | ||
314 | * An error occured, but it recovered. Inform the | ||
315 | * user, but make sure that it's not treated as a | ||
316 | * hard error. | ||
317 | */ | ||
318 | scsi_print_sense("sr", SCpnt); | ||
319 | SCpnt->result = 0; | ||
320 | SCpnt->sense_buffer[0] = 0x0; | ||
321 | good_bytes = this_count; | 312 | good_bytes = this_count; |
322 | break; | 313 | break; |
323 | 314 | ||