All,
here is a rewrite of the device mapper udev rules, as follow up
to the previous thread "About DM_UDEV_DISABLE_OTHER_RULES_FLAG and
DM_NOSCAN" [1]. While I have taken care to minimize the impact on
other udev rule sets, some changes to both the multipath-tools and
systemd rules will be necessary. Patches for these are in preparation.
In short, the effect of this patch set is as follows:
- As before, DM_UDEV_DISABLE_OTHER_RULES_FLAG is used as general flag to
indicate to follow-up rules that they should avoid probing the device, and
should import device properties from the udev db if necessary. The flag
does not imply that existing device stacks must be destructed. -
- DM_UDEV_DISABLE_OTHER_RULES_FLAG represents the combination of multiple
conditions that may make it impossible to probe the device just now. As
such, it isn't restored from the udev db, but determined anew for every
uevent. For saving the DM_COOKIE variable of the same name in the udev db,
a new variable DM_COOKIE_DISABLE_OTHER_RULES_FLAG is introduced.
- The properties DM_SUSPENDED and DM_NOSCAN, which have always been considered
internal to device-mapper and its subsystems, are renamed to .DM_SUSPENDED
and .DM_NOSCAN, respectively. Thus they aren't saved in the udev db any
more, and it becomes more obvious that they are not supposed to be used
by non-dm udev rules.
- ID_FS_TYPE is imported from the db for "spurious" events.
- Properties are imported for DISK_RO="?" events, too.
Changes from v1 ("RFC") patch set:
- Instead of removing the DISK_RO clause entirely, just moved it further down
(after the property import), and apply it for DISK_RO==0, too.
- Updated comments about device properties at the top of 10-dm.rules.
[1]
https://lore.kernel.org/linux-lvm/[email protected]/T/#t
Martin Wilck (7):
13-dm-disk.rules: import ID_FS_TYPE
10-dm.rules: test DISK_RO after importing properties
10-dm-rules: don't restore DM_UDEV_DISABLE_OTHER_RULES_FLAG from db
11-dm-lvm.rules: don't restore DM_UDEV_DISABLE_OTHER_RULES_FLAG from
db
dm udev rules: don't export and save DM_SUSPENDED
dm udev rules: don't export and save DM_NOSCAN
10-dm.rules: bump DM_UDEV_RULES_VSN to 3
udev/10-dm.rules.in | 43 +++++++++++++++++++++++++++---------
udev/11-dm-lvm.rules.in | 13 +++++------
udev/12-dm-permissions.rules | 2 +-
udev/13-dm-disk.rules.in | 9 ++++----
4 files changed, 43 insertions(+), 24 deletions(-)
--
2.43.2