* [PATCH] scsi_dh_alua: suppress errors from unsupported devices
@ 2017-08-04 6:37 Hannes Reinecke
2017-08-04 7:11 ` Johannes Thumshirn
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Hannes Reinecke @ 2017-08-04 6:37 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Christoph Hellwig, James Bottomley, linux-scsi, Hannes Reinecke,
Hannes Reinecke
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 <hare@suse.com>
---
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(-)
diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
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;
diff --git a/drivers/scsi/scsi_dh.c b/drivers/scsi/scsi_dh.c
index 84addee..16e780d 100644
--- 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);
} else
sdev->handler = scsi_dh;
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index d6984df..5e8ace2 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -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) {
--
1.8.5.6
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi_dh_alua: suppress errors from unsupported devices
2017-08-04 6:37 [PATCH] scsi_dh_alua: suppress errors from unsupported devices Hannes Reinecke
@ 2017-08-04 7:11 ` Johannes Thumshirn
2017-08-04 15:56 ` Bart Van Assche
2017-08-05 11:35 ` Christoph Hellwig
2 siblings, 0 replies; 5+ messages in thread
From: Johannes Thumshirn @ 2017-08-04 7:11 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Christoph Hellwig, James Bottomley,
linux-scsi, Hannes Reinecke
Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi_dh_alua: suppress errors from unsupported devices
2017-08-04 6:37 [PATCH] scsi_dh_alua: suppress errors from unsupported devices Hannes Reinecke
2017-08-04 7:11 ` Johannes Thumshirn
@ 2017-08-04 15:56 ` Bart Van Assche
2017-08-05 11:35 ` Christoph Hellwig
2 siblings, 0 replies; 5+ messages in thread
From: Bart Van Assche @ 2017-08-04 15:56 UTC (permalink / raw)
To: hare, martin.petersen; +Cc: hch, james.bottomley, linux-scsi, hare
On Fri, 2017-08-04 at 08:37 +0200, Hannes Reinecke wrote:
> 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 <bart.vanassche@wdc.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi_dh_alua: suppress errors from unsupported devices
2017-08-04 6:37 [PATCH] scsi_dh_alua: suppress errors from unsupported devices Hannes Reinecke
2017-08-04 7:11 ` Johannes Thumshirn
2017-08-04 15:56 ` Bart Van Assche
@ 2017-08-05 11:35 ` Christoph Hellwig
2017-08-07 6:07 ` Hannes Reinecke
2 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2017-08-05 11:35 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Christoph Hellwig, James Bottomley,
linux-scsi, Hannes Reinecke
> 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 */
In that case it should return void.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi_dh_alua: suppress errors from unsupported devices
2017-08-05 11:35 ` Christoph Hellwig
@ 2017-08-07 6:07 ` Hannes Reinecke
0 siblings, 0 replies; 5+ messages in thread
From: Hannes Reinecke @ 2017-08-07 6:07 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Martin K. Petersen, James Bottomley, linux-scsi, Hannes Reinecke
On 08/05/2017 01:35 PM, Christoph Hellwig wrote:
>> 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 */
>
> In that case it should return void.
>
Okay, will be updating the patch.
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare@suse.de +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)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-08-07 6:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-04 6:37 [PATCH] scsi_dh_alua: suppress errors from unsupported devices Hannes Reinecke
2017-08-04 7:11 ` Johannes Thumshirn
2017-08-04 15:56 ` Bart Van Assche
2017-08-05 11:35 ` Christoph Hellwig
2017-08-07 6:07 ` Hannes Reinecke
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.