summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/device_handler
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2016-03-03 07:54:11 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2016-03-05 17:20:33 -0500
commit0323375c8bc5c101c9284856cac19a0b9ece71d4 (patch)
tree67376b5e4d1ff54389446136c9d52e44114524da /drivers/scsi/device_handler
parent1a5dc166cd8843252169f52cb714b324f6d679ef (diff)
downloadblackbird-op-linux-0323375c8bc5c101c9284856cac19a0b9ece71d4.tar.gz
blackbird-op-linux-0323375c8bc5c101c9284856cac19a0b9ece71d4.zip
scsi_dh_emc: update 'access_state' field
Update the 'access_state' field of the SCSI device whenever the path state changes. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@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_emc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/scsi/device_handler/scsi_dh_emc.c b/drivers/scsi/device_handler/scsi_dh_emc.c
index e6fb97cb12f4..375d81850f15 100644
--- a/drivers/scsi/device_handler/scsi_dh_emc.c
+++ b/drivers/scsi/device_handler/scsi_dh_emc.c
@@ -199,7 +199,12 @@ static int parse_sp_info_reply(struct scsi_device *sdev,
csdev->lun_state = csdev->buffer[4];
csdev->current_sp = csdev->buffer[8];
csdev->port = csdev->buffer[7];
-
+ if (csdev->lun_state == CLARIION_LUN_OWNED)
+ sdev->access_state = SCSI_ACCESS_STATE_OPTIMAL;
+ else
+ sdev->access_state = SCSI_ACCESS_STATE_STANDBY;
+ if (csdev->default_sp == csdev->current_sp)
+ sdev->access_state |= SCSI_ACCESS_STATE_PREFERRED;
out:
return err;
}
OpenPOWER on IntegriCloud