summaryrefslogtreecommitdiff
path: root/drivers/scsi/device_handler
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2020-09-30 11:02:55 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2020-11-11 06:58:12 +0300
commitfb908850ece3bc93a9d276f6dd8505d824b2789c (patch)
tree4156c2aa9d23c2ed379fc661e4b73c3913bd7599 /drivers/scsi/device_handler
parent268940b80fa4096397fd0a28e6ad807e64120215 (diff)
downloadlinux-fb908850ece3bc93a9d276f6dd8505d824b2789c.tar.xz
scsi: scsi_dh_alua: Set 'transitioning' state on Unit Attention
We should be setting the 'transitioning' ALUA state once we get a Unit Attention indicating the array is in transitioning. There are arrays which cannot respond to an RTPG while in transitioning, and others have issues correctly reporting the state. So better to set the state during Unit Attention handling and wait for TUR / RTPG to run its course. Link: https://lore.kernel.org/r/20200930080256.90964-4-hare@suse.de Reviewed-by: Ewan D. Milne <emilne@redhat.com> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/device_handler')
-rw-r--r--drivers/scsi/device_handler/scsi_dh_alua.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
index 9e8d32d01d91..92b592e9ebcb 100644
--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -408,12 +408,20 @@ static char print_alua_state(unsigned char state)
static int alua_check_sense(struct scsi_device *sdev,
struct scsi_sense_hdr *sense_hdr)
{
+ struct alua_dh_data *h = sdev->handler_data;
+ struct alua_port_group *pg;
+
switch (sense_hdr->sense_key) {
case NOT_READY:
if (sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x0a) {
/*
* LUN Not Accessible - ALUA state transition
*/
+ rcu_read_lock();
+ pg = rcu_dereference(h->pg);
+ if (pg)
+ pg->state = SCSI_ACCESS_STATE_TRANSITIONING;
+ rcu_read_unlock();
alua_check(sdev, false);
return NEEDS_RETRY;
}