summaryrefslogtreecommitdiff
path: root/drivers/scsi/scsi_error.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2013-07-01 15:16:25 +0200
committerJames Bottomley <JBottomley@Parallels.com>2013-08-23 12:43:54 -0400
commita9d6ceb838755c24dde8a0ca02c3378926fc63db (patch)
tree8239e44e9bee3029e31ee1ac04b14b73f5f500d1 /drivers/scsi/scsi_error.c
parent87f14e658f664a17dcdb38d3f6ae70642fcdc263 (diff)
downloadlwn-a9d6ceb838755c24dde8a0ca02c3378926fc63db.tar.gz
lwn-a9d6ceb838755c24dde8a0ca02c3378926fc63db.zip
[SCSI] return ENOSPC on thin provisioning failure
When the thin provisioning hard threshold is reached we should return ENOSPC to inform upper layers about this fact. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/scsi_error.c')
-rw-r--r--drivers/scsi/scsi_error.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 7be5229ed3a4..1b1298ce0e71 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -354,11 +354,16 @@ static int scsi_check_sense(struct scsi_cmnd *scmd)
return SUCCESS;
/* these are not supported */
+ case DATA_PROTECT:
+ if (sshdr.asc == 0x27 && sshdr.ascq == 0x07) {
+ /* Thin provisioning hard threshold reached */
+ set_host_byte(scmd, DID_ALLOC_FAILURE);
+ return SUCCESS;
+ }
case COPY_ABORTED:
case VOLUME_OVERFLOW:
case MISCOMPARE:
case BLANK_CHECK:
- case DATA_PROTECT:
set_host_byte(scmd, DID_TARGET_FAILURE);
return SUCCESS;