: create sysfs file, dh_state for SCSI devices even if they are not in the inteernal lists
Subsystems (2)
PATCH 1/1 : create sysfs file, dh_state for SCSI devices even if they are not in the inteernal lists
Create the sysfs file, dh_state even if the new SCSI device is not in the any of the device handler's internal lists.
--- drivers/scsi/device_handler/scsi_dh.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/scsi/device_handler/scsi_dh.c +4 -7
@@ -304,18 +304,15 @@ static int scsi_dh_notifier(struct notif sdev =to_scsi_device (dev);if (action ==BUS_NOTIFY_ADD_DEVICE ) { + err =device_create_file (dev, &scsi_dh_state_attr); +/* don't care about err */ devinfo =device_handler_match (NULL , sdev); -if (!devinfo) - goto out; - - err =scsi_dh_handler_attach (sdev, devinfo); -if (!err) - err =device_create_file (dev, &scsi_dh_state_attr); +if (devinfo) + err =scsi_dh_handler_attach (sdev, devinfo); }else if (action ==BUS_NOTIFY_DEL_DEVICE ) {device_remove_file (dev, &scsi_dh_state_attr);scsi_dh_handler_detach (sdev,NULL ); } -out:return err; }
Hannes Reinecke
NAKQuoted 38 lines · Chandra Seetharaman
Create the sysfs file,
dh_stateeven if the new SCSI device is not in the any of the device handler's internal lists.Signed-off-by Chandra Seetharaman <[email protected]>--- drivers/scsi/device_handler/scsi_dh.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)Index:
linux-2.6.31-rc1/drivers/scsi/device_handler/scsi_dh.c
===================================================================drivers/scsi/device_handler/scsi_dh.c +4
-8@@ -304,18 +304,15 @@ static int scsi_dh_notifier(struct notif sdev =to_scsi_device (dev);if (action ==BUS_NOTIFY_ADD_DEVICE ) { + err =device_create_file (dev, &scsi_dh_state_attr); +/* don't care about err */ devinfo =device_handler_match (NULL , sdev); -if (!devinfo) - goto out; - - err =scsi_dh_handler_attach (sdev, devinfo); -if (!err) - err =device_create_file (dev, &scsi_dh_state_attr); +if (devinfo) + err =scsi_dh_handler_attach (sdev, devinfo); }else if (action ==BUS_NOTIFY_DEL_DEVICE ) {device_remove_file (dev, &scsi_dh_state_attr);scsi_dh_handler_detach (sdev,NULL ); } -out:return err; } --
Quoted 3 lines
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel
NACK.
This will create sysfs attributes even if the attach() failed for other reason like a generic error. So we'll end up with device handler attributes and no device handler attached.
Not a good idea.
Cheers,
Hannes
Signature · 8 lines
Dr. Hannes Reinecke zSeries & Storage [email protected] +49 911 74053 688 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
James Bottomley
maintainerQuoted 44 lines · Hannes Reinecke
Quoted 38 lines · Chandra Seetharaman
Create the sysfs file,
dh_stateeven if the new SCSI device is not in the any of the device handler's internal lists.Signed-off-by Chandra Seetharaman <[email protected]>--- drivers/scsi/device_handler/scsi_dh.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)Index:
linux-2.6.31-rc1/drivers/scsi/device_handler/scsi_dh.c
===================================================================drivers/scsi/device_handler/scsi_dh.c +4
-8@@ -304,18 +304,15 @@ static int scsi_dh_notifier(struct notif sdev =to_scsi_device (dev);if (action ==BUS_NOTIFY_ADD_DEVICE ) { + err =device_create_file (dev, &scsi_dh_state_attr); +/* don't care about err */ devinfo =device_handler_match (NULL , sdev); -if (!devinfo) - goto out; - - err =scsi_dh_handler_attach (sdev, devinfo); -if (!err) - err =device_create_file (dev, &scsi_dh_state_attr); +if (devinfo) + err =scsi_dh_handler_attach (sdev, devinfo); }else if (action ==BUS_NOTIFY_DEL_DEVICE ) {device_remove_file (dev, &scsi_dh_state_attr);scsi_dh_handler_detach (sdev,NULL ); } -out:return err; } --Quoted 3 lines
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-develNACK.
Quoted 5 lines
This will create sysfs attributes even if the
attach()failed for other reason like a generic error. So we'll end up with device handler attributes and no device handler attached.Not a good idea.
It strikes me that what is really being reinvented here is driver attachment with driver attribute files ...
Now all of this could be avoided if we had multiple attachment of drivers ...
James
Quoted 45 lines · James Bottomley
Quoted 44 lines · Hannes Reinecke
Quoted 27 lines · Chandra Seetharaman
Create the sysfs file,
dh_stateeven if the new SCSI device is not in the any of the device handler's internal lists.Signed-off-by Chandra Seetharaman <[email protected]>--- drivers/scsi/device_handler/scsi_dh.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)Index:
linux-2.6.31-rc1/drivers/scsi/device_handler/scsi_dh.c
===================================================================drivers/scsi/device_handler/scsi_dh.c +2
-6@@ -304,18 +304,15 @@ static int scsi_dh_notifier(struct notif sdev =to_scsi_device (dev);if (action ==BUS_NOTIFY_ADD_DEVICE ) { + err =device_create_file (dev, &scsi_dh_state_attr); +/* don't care about err */ devinfo =device_handler_match (NULL , sdev); -if (!devinfo) - goto out; - - err =scsi_dh_handler_attach (sdev, devinfo); -if (!err) - err =device_create_file (dev, &scsi_dh_state_attr);drivers/scsi/device_handler/scsi_dh.c static int scsi_dh_notifier(struct notif · line 318
Quoted 10 lines
drivers/scsi/device_handler/scsi_dh.c +2
-1+if (devinfo) + err =scsi_dh_handler_attach (sdev, devinfo); }else if (action ==BUS_NOTIFY_DEL_DEVICE ) {device_remove_file (dev, &scsi_dh_state_attr);scsi_dh_handler_detach (sdev,NULL ); } -out:return err; }NACK.
This will create sysfs attributes even if the
attach()failed for other reason like a generic error. So we'll end up with device handler attributes and no device handler attached.
Quoted 8 lines
Quoted 1 line
Not a good idea.
It strikes me that what is really being reinvented here is driver attachment with driver attribute files ...
Now all of this could be avoided if we had multiple attachment of drivers ...
I heard you.
If you find someone to fix the blasted iSCSI I/O stall for me ...
Cheers,
Hannes
Signature · 8 lines
Dr. Hannes Reinecke zSeries & Storage [email protected] +49 911 74053 688 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 44 lines · Hannes Reinecke
Quoted 38 lines · Chandra Seetharaman
Create the sysfs file,
dh_stateeven if the new SCSI device is not in the any of the device handler's internal lists.Signed-off-by Chandra Seetharaman <[email protected]>--- drivers/scsi/device_handler/scsi_dh.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)Index:
linux-2.6.31-rc1/drivers/scsi/device_handler/scsi_dh.c
===================================================================drivers/scsi/device_handler/scsi_dh.c +4
-8@@ -304,18 +304,15 @@ static int scsi_dh_notifier(struct notif sdev =to_scsi_device (dev);if (action ==BUS_NOTIFY_ADD_DEVICE ) { + err =device_create_file (dev, &scsi_dh_state_attr); +/* don't care about err */ devinfo =device_handler_match (NULL , sdev); -if (!devinfo) - goto out; - - err =scsi_dh_handler_attach (sdev, devinfo); -if (!err) - err =device_create_file (dev, &scsi_dh_state_attr); +if (devinfo) + err =scsi_dh_handler_attach (sdev, devinfo); }else if (action ==BUS_NOTIFY_DEL_DEVICE ) {device_remove_file (dev, &scsi_dh_state_attr);scsi_dh_handler_detach (sdev,NULL ); } -out:return err; } --Quoted 3 lines
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-develNACK.
Quoted 3 lines
This will create sysfs attributes even if the
attach()failed for other reason like a generic error. So we'll end up with device handler attributes and no device handler attached.
we do not have to worry about if attach failed or succeeded. We will have "detached" if there is no device handler is attached to a device.
Basically, existence of this file simply means that scsi_dh module is active, only the contents of this file will indicate if any device handler is attached or not.
We are just creating the file dh_state for each SCSI device that exists and that is the only way non-in-built devices can be attached to a handler by the end-user.
Do note that we do create this file for all the existing scsi devices when the scsi_dh module is inserted (see scsi_dh_init()).
Quoted 2 lines
Not a good idea.
I do not agree, and we do need to have this fix for dh_state file to be functionally useful.
Quoted 4 lines
Cheers,
Hannes
Hannes,
any comments ?
chandra
Quoted 73 lines · Chandra Seetharaman
Quoted 44 lines · Hannes Reinecke
Quoted 38 lines · Chandra Seetharaman
Create the sysfs file,
dh_stateeven if the new SCSI device is not in the any of the device handler's internal lists.Signed-off-by Chandra Seetharaman <[email protected]>--- drivers/scsi/device_handler/scsi_dh.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)Index:
linux-2.6.31-rc1/drivers/scsi/device_handler/scsi_dh.c
===================================================================drivers/scsi/device_handler/scsi_dh.c +4
-8@@ -304,18 +304,15 @@ static int scsi_dh_notifier(struct notif sdev =to_scsi_device (dev);if (action ==BUS_NOTIFY_ADD_DEVICE ) { + err =device_create_file (dev, &scsi_dh_state_attr); +/* don't care about err */ devinfo =device_handler_match (NULL , sdev); -if (!devinfo) - goto out; - - err =scsi_dh_handler_attach (sdev, devinfo); -if (!err) - err =device_create_file (dev, &scsi_dh_state_attr); +if (devinfo) + err =scsi_dh_handler_attach (sdev, devinfo); }else if (action ==BUS_NOTIFY_DEL_DEVICE ) {device_remove_file (dev, &scsi_dh_state_attr);scsi_dh_handler_detach (sdev,NULL ); } -out:return err; } --Quoted 3 lines
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-develNACK.
Quoted 3 lines
This will create sysfs attributes even if the
attach()failed for other reason like a generic error. So we'll end up with device handler attributes and no device handler attached.we do not have to worry about if attach failed or succeeded. We will have "detached" if there is no device handler is attached to a device.
Basically, existence of this file simply means that
scsi_dhmodule is active, only the contents of this file will indicate if any device handler is attached or not.We are just creating the file
dh_statefor each SCSI device that exists and that is the only way non-in-built devices can be attached to a handler by the end-user.Do note that we do create this file for all the existing scsi devices when the
scsi_dhmodule is inserted (seescsi_dh_init()).Quoted 2 lines
Not a good idea.
I do not agree, and we do need to have this fix for
dh_statefile to be functionally useful.Quoted 4 lines
Cheers,
Hannes
Hi Hannes,
Can you comment on this please.
If you are convinced with my justification, please send an ACK.
Thanks & Regards,
chandra
Quoted 73 lines · Chandra Seetharaman
Quoted 44 lines · Hannes Reinecke
Quoted 38 lines · Chandra Seetharaman
Create the sysfs file,
dh_stateeven if the new SCSI device is not in the any of the device handler's internal lists.Signed-off-by Chandra Seetharaman <[email protected]>--- drivers/scsi/device_handler/scsi_dh.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)Index:
linux-2.6.31-rc1/drivers/scsi/device_handler/scsi_dh.c
===================================================================drivers/scsi/device_handler/scsi_dh.c +4
-8@@ -304,18 +304,15 @@ static int scsi_dh_notifier(struct notif sdev =to_scsi_device (dev);if (action ==BUS_NOTIFY_ADD_DEVICE ) { + err =device_create_file (dev, &scsi_dh_state_attr); +/* don't care about err */ devinfo =device_handler_match (NULL , sdev); -if (!devinfo) - goto out; - - err =scsi_dh_handler_attach (sdev, devinfo); -if (!err) - err =device_create_file (dev, &scsi_dh_state_attr); +if (devinfo) + err =scsi_dh_handler_attach (sdev, devinfo); }else if (action ==BUS_NOTIFY_DEL_DEVICE ) {device_remove_file (dev, &scsi_dh_state_attr);scsi_dh_handler_detach (sdev,NULL ); } -out:return err; } --Quoted 3 lines
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-develNACK.
Quoted 3 lines
This will create sysfs attributes even if the
attach()failed for other reason like a generic error. So we'll end up with device handler attributes and no device handler attached.we do not have to worry about if attach failed or succeeded. We will have "detached" if there is no device handler is attached to a device.
Basically, existence of this file simply means that
scsi_dhmodule is active, only the contents of this file will indicate if any device handler is attached or not.We are just creating the file
dh_statefor each SCSI device that exists and that is the only way non-in-built devices can be attached to a handler by the end-user.Do note that we do create this file for all the existing scsi devices when the
scsi_dhmodule is inserted (seescsi_dh_init()).Quoted 2 lines
Not a good idea.
I do not agree, and we do need to have this fix for
dh_statefile to be functionally useful.Quoted 4 lines
Cheers,
Hannes
Hannes Reinecke
Acked-byQuoted 72 lines · Chandra Seetharaman
Hi Hannes,
Can you comment on this please.
If you are convinced with my justification, please send an ACK.
Thanks & Regards,
chandra
Quoted 62 lines · Chandra Seetharaman
Quoted 44 lines · Hannes Reinecke
Quoted 38 lines · Chandra Seetharaman
Create the sysfs file,
dh_stateeven if the new SCSI device is not in the any of the device handler's internal lists.Signed-off-by Chandra Seetharaman <[email protected]>--- drivers/scsi/device_handler/scsi_dh.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)Index:
linux-2.6.31-rc1/drivers/scsi/device_handler/scsi_dh.c
===================================================================drivers/scsi/device_handler/scsi_dh.c +4
-8@@ -304,18 +304,15 @@ static int scsi_dh_notifier(struct notif sdev =to_scsi_device (dev);if (action ==BUS_NOTIFY_ADD_DEVICE ) { + err =device_create_file (dev, &scsi_dh_state_attr); +/* don't care about err */ devinfo =device_handler_match (NULL , sdev); -if (!devinfo) - goto out; - - err =scsi_dh_handler_attach (sdev, devinfo); -if (!err) - err =device_create_file (dev, &scsi_dh_state_attr); +if (devinfo) + err =scsi_dh_handler_attach (sdev, devinfo); }else if (action ==BUS_NOTIFY_DEL_DEVICE ) {device_remove_file (dev, &scsi_dh_state_attr);scsi_dh_handler_detach (sdev,NULL ); } -out:return err; } --Quoted 3 lines
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-develNACK.
Quoted 3 lines
This will create sysfs attributes even if the
attach()failed for other reason like a generic error. So we'll end up with device handler attributes and no device handler attached.we do not have to worry about if attach failed or succeeded. We will have "detached" if there is no device handler is attached to a device.
Basically, existence of this file simply means that
scsi_dhmodule is active, only the contents of this file will indicate if any device handler is attached or not.We are just creating the file
dh_statefor each SCSI device that exists and that is the only way non-in-built devices can be attached to a handler by the end-user.Do note that we do create this file for all the existing scsi devices when the
scsi_dhmodule is inserted (seescsi_dh_init()).
Right. So you're changing the semantics from the 'dh_state' attribute to mean 'scsi_dh' is active, not 'a scsi_dh module has been attached'.
Ok, that seems reasonable.
Cheers,
Hannes
Signature · 4 lines
Dr. Hannes Reinecke zSeries & Storage [email protected] +49 911 74053 688 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Markus Rex, HRB 16746 (AG Nürnberg)
PATCH RESEND 1/1 : scsi_dh: create sysfs file, dh_state for SCSI devices even if they are not in the internal lists
In reply to Chandra SeetharamanHi James,
This patch was sent to the list long back and was Acked by Hannes on Aug 11.
Please consider for inclusion. Let me know if you see any issues with the patch.
regards,
chandra
-------------------------
Create the sysfs file, dh_state even if the new SCSI device is not in the any of the device handler's internal lists.
--- drivers/scsi/device_handler/scsi_dh.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/scsi/device_handler/scsi_dh.c +4 -7
@@ -292,18 +292,15 @@ static int scsi_dh_notifier(struct notif sdev =to_scsi_device (dev);if (action ==BUS_NOTIFY_ADD_DEVICE ) { + err =device_create_file (dev, &scsi_dh_state_attr); +/* don't care about err */ devinfo =device_handler_match (NULL , sdev); -if (!devinfo) - goto out; - - err =scsi_dh_handler_attach (sdev, devinfo); -if (!err) - err =device_create_file (dev, &scsi_dh_state_attr); +if (devinfo) + err =scsi_dh_handler_attach (sdev, devinfo); }else if (action ==BUS_NOTIFY_DEL_DEVICE ) {device_remove_file (dev, &scsi_dh_state_attr);scsi_dh_handler_detach (sdev,NULL ); } -out:return err; }