Skip to contentSkip to conversation

DRIVER vs. PHYSDEVDRIVER for block susbsystem

DISCUSSION Andrey Borzenkov 2 participants 7 messages Mar 25, 2006

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The example persistent rules distributed with udev use DRIVER matching for SUBSYSTEM=block. Unfortunately, it appears that DRIVER is simply not defined in this case - it is fetched only for the case when devpath is /devices/* not /block/*.

It effectively means that for IDE CD-ROMs persistent rules are never executed, see also http://qa.mandriva.com/show_bug.cgi?id!720.

Is DRIVER expected to be set for SUBSYSTEM=block (I will submit patch)? Otherwise it would be nice to fix examples in rules.

Thank you

- -andrey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFEJYr8R6LMutpd94wRAnMcAJ0RrAN2rXMMY7BcemqyT8t30Biz4gCgxeMD b5KrUSOujKE0FAcFkaUD5Go=wsdk
-----END PGP SIGNATURE-----

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 4 lines · Andrey Borzenkov

The example persistent rules distributed with udev use DRIVER matching for SUBSYSTEM=block. Unfortunately, it appears that DRIVER is simply not defined in this case - it is fetched only for the case when devpath is /devices/* not /block/*.

No DRIVER matches up the whole chain of devices. But the driver value of block is "" which matches successfully the non-match of the values it is compared against.

The rules have changed and should work that way:
http://www.kernel.org/git/?p=linux/hotplug/udev.git;a=blob;hb=HEAD;f=etc/udev/60-persistent-storage.rules

Quoted 2 lines

It effectively means that for IDE CD-ROMs persistent rules are never executed, see also http://qa.mandriva.com/show_bug.cgi?id!720.

We should not introduce any new users of the "device" link or the PHYSDEV* values, they will go away some day along with the odd idea to distinguish between class and physical devices.

Quoted 2 lines

Is DRIVER expected to be set for SUBSYSTEM=block (I will submit patch)? Otherwise it would be nice to fix examples in rules.

No, class devices don't have a driver for now.

Thanks,
Kay

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Andrey Borzenkov

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 6 lines · Kay Sievers
Quoted 4 lines · Andrey Borzenkov

The example persistent rules distributed with udev use DRIVER matching for SUBSYSTEM=block. Unfortunately, it appears that DRIVER is simply not defined in this case - it is fetched only for the case when devpath is /devices/* not /block/*.

Quoted 9 lines

No DRIVER matches up the whole chain of devices. But the driver value of block is "" which matches successfully the non-match of the values it is compared against.

The rules have changed and should work that way:

http://www.kernel.org/git/?p=linux/hotplug/udev.git;a=blob;hb=HEAD;f=etc/ud
ev/60-persistent-storage.rules

Those rules will never match for ide-cs or ide-floppy as intended (while this "fixes" it for ide-cdrom, sure :)

Quoted 9 lines

We should not introduce any new users of the "device" link or the PHYSDEV* values, they will go away some day along with the odd idea to distinguish between class and physical devices.

Quoted 2 lines

Is DRIVER expected to be set for SUBSYSTEM=block (I will submit patch)? Otherwise it would be nice to fix examples in rules.

No, class devices don't have a driver for now.

In this case adding driver for block devices looks like the right thing, does not it? Strictly speaking, it could be generalized to "if device symlink exists, fetch driver from it"; this will go away when sysfs layout will have changed.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFEJZWvR6LMutpd94wRAjEYAKDQ/WZVjsAOy8ag7K5Pya4F07+qHQCbBnOM zv1UWpLC8ax5HoZSCS0RbQw=XkPH
-----END PGP SIGNATURE-----

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#3 lore raw
In reply to Andrey Borzenkov
Quoted 14 lines · Andrey Borzenkov

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 10 lines · Kay Sievers
Quoted 4 lines · Andrey Borzenkov

The example persistent rules distributed with udev use DRIVER matching for SUBSYSTEM=block. Unfortunately, it appears that DRIVER is simply not defined in this case - it is fetched only for the case when devpath is /devices/* not /block/*.

No DRIVER matches up the whole chain of devices. But the driver value of block is "" which matches successfully the non-match of the values it is compared against.

Quoted 8 lines
Quoted 5 lines

The rules have changed and should work that way:

http://www.kernel.org/git/?p=linux/hotplug/udev.git;a=blob;hb=HEAD;f=etc/ud
ev/60-persistent-storage.rules

Those rules will never match for ide-cs or ide-floppy as intended (while this "fixes" it for ide-cdrom, sure :)

Care to explain?

Quoted 7 lines
Quoted 7 lines

We should not introduce any new users of the "device" link or the PHYSDEV* values, they will go away some day along with the odd idea to distinguish between class and physical devices.

Quoted 2 lines

Is DRIVER expected to be set for SUBSYSTEM=block (I will submit patch)? Otherwise it would be nice to fix examples in rules.

Quoted 7 lines
Quoted 2 lines

No, class devices don't have a driver for now.

In this case adding driver for block devices looks like the right thing, does not it? Strictly speaking, it could be generalized to "if device symlink exists, fetch driver from it"; this will go away when sysfs layout will have changed.

No, the block devices don't have a driver.

Thanks,
Kay

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#4 lore raw
In reply to Andrey Borzenkov

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 6 lines · Kay Sievers
Quoted 6 lines
Quoted 6 lines

No DRIVER matches up the whole chain of devices. But the driver value of block is "" which matches successfully the non-match of the values it is compared against.

The rules have changed and should work that way:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

http://www.kernel.org/git/?p=linux/hotplug/udev.git;a=blob;hb=HEAD;f=et
c/ud ev/60-persistent-storage.rules

Those rules will never match for ide-cs or ide-floppy as intended (while this "fixes" it for ide-cdrom, sure :)

Care to explain?

Sure. As you stated before, 'driver value of block is ""'. The "" can never match "ide-cd|ide-floppy". And non-block are filtered away two lines before.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

We should not introduce any new users of the "device" link or the PHYSDEV* values, they will go away some day along with the odd idea to distinguish between class and physical devices.

[...]

Quoted 7 lines
Quoted 4 lines

In this case adding driver for block devices looks like the right thing, does not it? Strictly speaking, it could be generalized to "if device symlink exists, fetch driver from it"; this will go away when sysfs layout will have changed.

No, the block devices don't have a driver.

Is not this the "odd idea to distinguish between class and physical device"? :)

Regards

- -andrey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFEJZs+R6LMutpd94wRAhlhAKCBf5wJk8YF7mAKGasYGKk4QooaBACeMz6M 3JKACK6OUVHaepBjRDuGaEUj1H
-----END PGP SIGNATURE-----

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#5 lore raw
In reply to Andrey Borzenkov
Quoted 14 lines · Andrey Borzenkov

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 9 lines · Kay Sievers
Quoted 9 lines
Quoted 8 lines

No DRIVER matches up the whole chain of devices. But the driver value of block is "" which matches successfully the non-match of the values it is compared against.

The rules have changed and should work that way:

http://www.kernel.org/git/?p=linux/hotplug/udev.git;a=blob;hb=HEAD;f=et
c/ud ev/60-persistent-storage.rules

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Those rules will never match for ide-cs or ide-floppy as intended (while this "fixes" it for ide-cdrom, sure :)

Care to explain?

Sure. As you stated before, 'driver value of block is ""'. The "" can never match "ide-cd|ide-floppy". And non-block are filtered away two lines before.

No, DRIVER matches up the chain of all devices, it has nothing to do with the event a non-block device. Did you test it?

Quoted 9 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

We should not introduce any new users of the "device" link or the PHYSDEV* values, they will go away some day along with the odd idea to distinguish between class and physical devices.

[...]

Quoted 5 lines
Quoted 4 lines

In this case adding driver for block devices looks like the right thing, does not it? Strictly speaking, it could be generalized to "if device symlink exists, fetch driver from it"; this will go away when sysfs layout will have changed.

Quoted 5 lines
Quoted 2 lines

No, the block devices don't have a driver.

Is not this the "odd idea to distinguish between class and physical device"? :)

No, it's not. The correct value for the driver of a blockdev is "", as there is no driver. Copying the value from the parent would be wrong.

Kay

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#6 lore raw
In reply to Andrey Borzenkov

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Kay Sievers

No, DRIVER matches up the chain of all devices, it has nothing to do with the event a non-block device. Did you test it?

you are right, sorry. Thank you for your patience.

- -andrey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFEJaMCR6LMutpd94wRArgIAJ0U5nQC6e7j3HYUB6LtHzmMgWTZeACg0SIQ YENMLY3ysD/H7UtGtUeWV9s=RWA8
-----END PGP SIGNATURE-----

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel