Re: [PATCHv2] scsi_dh_alua: suppress errors from unsupported devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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?



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux