From 72ab860811e14e37db81fb409abf0fa7e7fe32cb Mon Sep 17 00:00:00 2001
From: Jack Wang <jinpu.wang@profitbricks.com>
Date: Tue, 10 May 2016 10:10:59 +0200
Subject: [PATCH] scsi: requeue command on capacity data has changed
We hit IO error in our production on multipath devices during resize
device on target side, the problem turns out scsi driver passes up as IO
error when sense data is UNIT_ATTENTION and ASC && ASCQ indicate
Capacity data has changed, even storage side sync the data properly.
To fix this, when condition met, we simply requeue the command.
Reported-by: Sebastian Parschauer <s.parschauer@gmx.de>
Signed-off-by: Jack Wang <jinpu.wang@profitbricks.com>
---
drivers/scsi/scsi_lib.c | 5 +++++
1 file changed, 5 insertions(+)
@@ -910,6 +910,11 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
error = 0;
}
+ if (sense_valid && (sshdr.sense_key == UNIT_ATTENTION)) {
+ if ((sshdr.asc == 0x2a && sshdr.ascq == 0x09))
+ goto requeue;
+ }
+
/*
* If we finished all bytes in the request we are done now.
*/
--
1.9.1