scsi_dh_alua: suppress errors from unsupported devices
PATCH 1/1 scsi_dh_alua: suppress errors from unsupported devices
ALUA is only relevant for disk-like devices, so we shouldn't be printing out warning messages for other device types.
Signed-off-by Hannes Reinecke <[email protected]>
--- drivers/scsi/device_handler/scsi_dh_alua.c | 2 ++ drivers/scsi/scsi_dh.c | 5 +++-- drivers/scsi/scsi_sysfs.c | 7 +------ 3 files changed, 6 insertions(+), 8 deletions(-)
drivers/scsi/device_handler/scsi_dh_alua.c +2 -0
@@ -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;
drivers/scsi/scsi_dh.c +3 -2
@@ -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); }else sdev->handler = scsi_dh;
drivers/scsi/scsi_sysfs.c +1 -6
@@ -1222,12 +1222,7 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)scsi_autopm_get_device (sdev); error =scsi_dh_add_device (sdev); -if (error) -/* -* device_handler is optional, so any error can be ignored -*/ -sdev_printk (KERN_INFO , sdev, -"failed to add device handler: %d\n" , error); +/* device_handler is optional, so any error can be ignored */ error =device_add (&sdev->sdev_gendev);if (error) {
Signature · 1 line
1.8.5.6
Looks good,
Reviewed-by Johannes Thumshirn <[email protected]>
Signature · 6 lines
Johannes Thumshirn Storage [email protected] +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Quoted 2 lines · Hannes Reinecke
ALUA is only relevant for disk-like devices, so we shouldn't be printing out warning messages for other device types.
Reviewed-by Bart Van Assche <[email protected]>
drivers/scsi/scsi_sysfs.c int scsi_sysfs_add_sdev(struct scsi_device *sdev) · line 1225
Quoted 8 lines
drivers/scsi/scsi_sysfs.c +1
-6error =scsi_dh_add_device (sdev); -if (error) -/* -* device_handler is optional, so any error can be ignored -*/ -sdev_printk (KERN_INFO , sdev, -"failed to add device handler: %d\n" , error); +/* device_handler is optional, so any error can be ignored */
In that case it should return void.
Quoted 11 lines · Christoph Hellwig
drivers/scsi/scsi_sysfs.c int scsi_sysfs_add_sdev(struct scsi_device *sdev) · line 1225
Quoted 8 lines
drivers/scsi/scsi_sysfs.c +1
-6error =scsi_dh_add_device (sdev); -if (error) -/* -* device_handler is optional, so any error can be ignored -*/ -sdev_printk (KERN_INFO , sdev, -"failed to add device handler: %d\n" , error); +/* device_handler is optional, so any error can be ignored */ In that case it should return void.
Okay, will be updating the patch.
Cheers,
Hannes
Signature · 5 lines
Dr. Hannes Reinecke Teamlead Storage & Networking [email protected] +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)