diff options
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 10430d500792..393f9db8f41b 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -867,6 +867,17 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) | |||
867 | /* for passthrough error may be set */ | 867 | /* for passthrough error may be set */ |
868 | error = BLK_STS_OK; | 868 | error = BLK_STS_OK; |
869 | } | 869 | } |
870 | /* | ||
871 | * Another corner case: the SCSI status byte is non-zero but 'good'. | ||
872 | * Example: PRE-FETCH command returns SAM_STAT_CONDITION_MET when | ||
873 | * it is able to fit nominated LBs in its cache (and SAM_STAT_GOOD | ||
874 | * if it can't fit). Treat SAM_STAT_CONDITION_MET and the related | ||
875 | * intermediate statuses (both obsolete in SAM-4) as good. | ||
876 | */ | ||
877 | if (status_byte(result) && scsi_status_is_good(result)) { | ||
878 | result = 0; | ||
879 | error = BLK_STS_OK; | ||
880 | } | ||
870 | 881 | ||
871 | /* | 882 | /* |
872 | * special case: failed zero length commands always need to | 883 | * special case: failed zero length commands always need to |