From a9bddd74630b2a1f2dedc537417c372b2d9edc76 Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Mon, 30 Mar 2009 16:55:51 +0000 Subject: [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 --- drivers/scsi/sr.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'drivers/scsi/sr.c') diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index e7fa3ca..0e1a0f2 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -309,15 +309,6 @@ static int sr_done(struct scsi_cmnd *SCpnt) break; case RECOVERED_ERROR: - - /* - * An error occured, but it recovered. Inform the - * user, but make sure that it's not treated as a - * hard error. - */ - scsi_print_sense("sr", SCpnt); - SCpnt->result = 0; - SCpnt->sense_buffer[0] = 0x0; good_bytes = this_count; break; -- cgit v1.1