On 08/09/2017 06:08 PM, Christoph Hellwig wrote: >> index 0962fd5..c3aea06 100644 >> --- a/drivers/scsi/device_handler/scsi_dh_alua.c >> +++ b/drivers/scsi/device_handler/scsi_dh_alua.c >> @@ -1100,6 +1100,8 @@ static int alua_bus_attach(struct scsi_device *sdev) >> err = alua_initialize(sdev, h); >> if (err == SCSI_DH_NOMEM) >> ret = -ENOMEM; >> + if (err == SCSI_DH_DEV_UNSUPP) >> + ret = -ENODEV; >> if (err != SCSI_DH_OK && err != SCSI_DH_DEV_OFFLINED) >> goto failed; > > This screams for a switch statement.. > >> --- a/drivers/scsi/scsi_dh.c >> +++ b/drivers/scsi/scsi_dh.c >> @@ -133,8 +133,9 @@ static int scsi_dh_handler_attach(struct scsi_device *sdev, >> >> error = scsi_dh->attach(sdev); >> if (error) { >> - sdev_printk(KERN_ERR, sdev, "%s: Attach failed (%d)\n", >> - scsi_dh->name, error); >> + if (error != -ENODEV) >> + sdev_printk(KERN_ERR, sdev, "%s: Attach failed (%d)\n", >> + scsi_dh->name, error); >> module_put(scsi_dh->module); > > OTOH why don't we just return the SCSI_DH_ values from ->attach? > Hmm. Not a bad idea. Let's see how it turns out. Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@xxxxxxx +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)