On 05/04/15 14:42, Hannes Reinecke wrote:
Non-disk devices should be ignored when detecting ALUA capabilities. Signed-off-by: Hannes Reinecke <hare@xxxxxxx> --- 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:
Reviewed-by: Bart Van Assche <bart.vanassche@xxxxxxxxxxx> -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html