]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/scsi_lib.c
Merge branch 'omap-pool'
[linux-2.6-omap-h63xx.git] / drivers / scsi / scsi_lib.c
index 4b13e36d3aa0b000b3c2bd5aa6d92a0c0b1554be..d1cb64ad1a3f373092d954804fa41cca636ccfcd 100644 (file)
@@ -791,7 +791,22 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
                                      "%d bytes done.\n",
                                      req->nr_sectors, good_bytes));
 
-       /* A number of bytes were successfully read.  If there
+       /*
+        * Recovered errors need reporting, but they're always treated
+        * as success, so fiddle the result code here.  For BLOCK_PC
+        * we already took a copy of the original into rq->errors which
+        * is what gets returned to the user
+        */
+       if (sense_valid && sshdr.sense_key == RECOVERED_ERROR) {
+               if (!(req->cmd_flags & REQ_QUIET))
+                       scsi_print_sense("", cmd);
+               result = 0;
+               /* BLOCK_PC may have set error */
+               error = 0;
+       }
+
+       /*
+        * A number of bytes were successfully read.  If there
         * are leftovers and there is some kind of error
         * (result != 0), retry the rest.
         */