aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_lib.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2013-07-01 09:16:26 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-08-23 12:54:53 -0400
commit7e782af57649f8a8e943d80104c946a5cd7af7cc (patch)
tree3ad0cfe04ce16a2a07c50cdfa55a60149de50fc7 /drivers/scsi/scsi_lib.c
parenta9d6ceb838755c24dde8a0ca02c3378926fc63db (diff)
[SCSI] Return ENODATA on medium error
When a medium error is detected the SCSI stack should return ENODATA to the upper layers. [jejb: fix whitespace error] Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r--drivers/scsi/scsi_lib.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 49020d52d685..36b5c898db9d 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -727,6 +727,7 @@ EXPORT_SYMBOL(scsi_release_buffers);
727 * -EREMOTEIO permanent target failure, do not retry 727 * -EREMOTEIO permanent target failure, do not retry
728 * -EBADE permanent nexus failure, retry on other path 728 * -EBADE permanent nexus failure, retry on other path
729 * -ENOSPC No write space available 729 * -ENOSPC No write space available
730 * -ENODATA Medium error
730 * -EIO unspecified I/O error 731 * -EIO unspecified I/O error
731 */ 732 */
732static int __scsi_error_from_host_byte(struct scsi_cmnd *cmd, int result) 733static int __scsi_error_from_host_byte(struct scsi_cmnd *cmd, int result)
@@ -749,6 +750,10 @@ static int __scsi_error_from_host_byte(struct scsi_cmnd *cmd, int result)
749 set_host_byte(cmd, DID_OK); 750 set_host_byte(cmd, DID_OK);
750 error = -ENOSPC; 751 error = -ENOSPC;
751 break; 752 break;
753 case DID_MEDIUM_ERROR:
754 set_host_byte(cmd, DID_OK);
755 error = -ENODATA;
756 break;
752 default: 757 default:
753 error = -EIO; 758 error = -EIO;
754 break; 759 break;