[SCSI] Ensure discard failure gets treated as a target problem
authorMartin K. Petersen <martin.petersen@oracle.com>
Mon, 13 Feb 2012 20:38:22 +0000 (15:38 -0500)
committerJames Bottomley <JBottomley@Parallels.com>
Sun, 19 Feb 2012 15:38:01 +0000 (09:38 -0600)
The error reported up the stack for a discard failure did not clearly
indicate that the command was processed and subsequently failed by the
target device.

Return -EREMOTEIO so multipathing does not classify this condition as a
path failure.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/scsi_lib.c

index 5b770e9e82c2035de9576236bf5dac59f4a0eafc..b4833deffd3bce5907213b3f43132f9013321f81 100644 (file)
@@ -880,6 +880,7 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
                                    cmd->cmnd[0] == WRITE_SAME)) {
                                description = "Discard failure";
                                action = ACTION_FAIL;
+                               error = -EREMOTEIO;
                        } else
                                action = ACTION_FAIL;
                        break;