From: Martin K. Petersen Date: Mon, 13 Feb 2012 20:38:22 +0000 (-0500) Subject: [SCSI] Ensure discard failure gets treated as a target problem X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=66a651aa7a48b7c6181aff556937454c87bb9feb;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [SCSI] Ensure discard failure gets treated as a target problem 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 Acked-by: Mike Snitzer Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 5b770e9e82c2..b4833deffd3b 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -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;