[PATCH 02/17] scsi_dh_alua: Disable ALUA handling for non-disk devices

Hannes Reinecke
2015-05-04T12:42:28Z

Non-disk devices should be ignored when detecting
ALUA capabilities.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/scsi/device_handler/scsi_dh_alua.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)

diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
index e418849..834e80f 100644
--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -320,6 +320,23 @@ static int alua_check_tpgs(struct scsi_device *sdev, struct alua_dh_data *h)
{
int err = SCSI_DH_OK;

+ if (scsi_is_wlun(sdev->lun)) {
+ h->tpgs = TPGS_MODE_NONE;
+ sdev_printk(KERN_INFO, sdev,
+ "%s: disable for WLUN\n",
+ ALUA_DH_NAME);
+ return SCSI_DH_DEV_UNSUPP;
+ }
+ if (sdev->type != TYPE_DISK &&
+ sdev->type != TYPE_RBC &&
+ sdev->type != TYPE_OSD) {
+ h->tpgs = TPGS_MODE_NONE;
+ sdev_printk(KERN_INFO, sdev,
+ "%s: disable for non-disk devices\n",
+ ALUA_DH_NAME);
+ return SCSI_DH_DEV_UNSUPP;
+ }
+
h->tpgs = scsi_device_tpgs(sdev);
switch (h->tpgs) {
case TPGS_MODE_EXPLICIT|TPGS_MODE_IMPLICIT:
--
1.8.5.2