aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sd.c
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2009-03-30 12:55:51 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-04-03 10:22:55 -0400
commita9bddd74630b2a1f2dedc537417c372b2d9edc76 (patch)
treed086a3d0770536bc0910ea9ad9eb4a35be273848 /drivers/scsi/sd.c
parenta2f5bfcf711aa72ad5587b533a1909334c2533a4 (diff)
[SCSI] fix recovered error handling
We have a problem with recovered error handling in that any command which goes down as BLOCK_PC but which returns a sense code of RECOVERED ERROR gets completed with -EIO. For actual SG_IO commands, this doesn't matter at all, since the error return code gets dropped in favour of req->errors which contain the SCSI completion code. However, if this command is part of the block system, then it will pay attention to the returned error code. In particularly if a SYNCHRONIZE CACHE from a barrier command completes with RECOVERED ERROR, the resulting -EIO on the barrier causes block to error the request and return it to the filesystem. Fix this by converting the -EIO for recovered error to zero, plus remove the printing of this from sd and sr so the message isn't double printed. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/sd.c')
-rw-r--r--drivers/scsi/sd.c6
1 files changed, 0 insertions, 6 deletions
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: