diff options
author | Hannes Reinecke <hare@suse.de> | 2013-07-01 17:16:26 +0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-08-23 20:54:53 +0400 |
commit | 7e782af57649f8a8e943d80104c946a5cd7af7cc (patch) | |
tree | 3ad0cfe04ce16a2a07c50cdfa55a60149de50fc7 /drivers/scsi/scsi_lib.c | |
parent | a9d6ceb838755c24dde8a0ca02c3378926fc63db (diff) | |
download | linux-7e782af57649f8a8e943d80104c946a5cd7af7cc.tar.xz |
[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.c | 5 |
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); * -EREMOTEIO permanent target failure, do not retry * -EBADE permanent nexus failure, retry on other path * -ENOSPC No write space available + * -ENODATA Medium error * -EIO unspecified I/O error */ static 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) set_host_byte(cmd, DID_OK); error = -ENOSPC; break; + case DID_MEDIUM_ERROR: + set_host_byte(cmd, DID_OK); + error = -ENODATA; + break; default: error = -EIO; break; |