From: Martin George Date: Tue, 26 Apr 2011 12:57:05 +0000 (+0530) Subject: [SCSI] scsi_dh_alua: Attach to UNAVAILABLE/OFFLINE AAS devices X-Git-Tag: v3.0-rc1~383^2~47 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c0d289b3e59577532c45ee9110ef81bd7b341272;p=karo-tx-linux.git [SCSI] scsi_dh_alua: Attach to UNAVAILABLE/OFFLINE AAS devices The SCSI ALUA handler currently fails to attach to devices reporting an UNAVAILABLE/OFFLINE AAS. But given that an UNAVAILABLE/OFFLINE AAS can transition to other states like ACTIVE/OPTIMIZED, ACTIVE/NON-OPTIMIZED, etc. as per SPC4, this ALUA handler behavior should be rectified so as to attach to devices which also report an UNAVAILABLE/OFFLINE AAS. Signed-off-by: Martin George Reviewed-by: Mike Christie Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c index 42fe52902add..6fec9fe5dc39 100644 --- a/drivers/scsi/device_handler/scsi_dh_alua.c +++ b/drivers/scsi/device_handler/scsi_dh_alua.c @@ -782,7 +782,7 @@ static int alua_bus_attach(struct scsi_device *sdev) h->sdev = sdev; err = alua_initialize(sdev, h); - if (err != SCSI_DH_OK) + if ((err != SCSI_DH_OK) && (err != SCSI_DH_DEV_OFFLINED)) goto failed; if (!try_module_get(THIS_MODULE))