Skip to contentSkip to conversation

11-dm-mpath.rules: fix misspelled DM_UDEV_DISABLE_OTHER_RULES_FLAG

PATCH In review Martin Wilck 3 participants 3 messages Mar 1, 2024 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 11-dm-mpath.rules: fix misspelled DM_UDEV_DISABLE_OTHER_RULES_FLAG

Fixes b3582da ("11-dm-mpath.rules: use import logic like 13-dm-disk.rules")
---
 multipath/11-dm-mpath.rules.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
multipath/11-dm-mpath.rules.in +1 -1
index d364f9b..d9585ab 100644
@@ -116,7 +116,7 @@ LABEL="scan_import"
 ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}!="1", GOTO="import_end"
 
 # Don't import the properties from db if we will run blkid later.
-ENV{DM_NOSCAN}!="1", ENV{DM_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="import_end"
+ENV{DM_NOSCAN}!="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="import_end"
 
 IMPORT{db}="ID_FS_TYPE"
 IMPORT{db}="ID_FS_USAGE"
Signature · 1 line
2.43.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 1 line · Martin Wilck
Fixes b3582da ("11-dm-mpath.rules: use import logic like 13-dm-disk.rules")
Quoted 20 lines
---
 multipath/11-dm-mpath.rules.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
multipath/11-dm-mpath.rules.in +1 -1
index d364f9b..d9585ab 100644
@@ -116,7 +116,7 @@ LABEL="scan_import"
 ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}!="1", GOTO="import_end"
 
 # Don't import the properties from db if we will run blkid later.
-ENV{DM_NOSCAN}!="1", ENV{DM_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="import_end"
+ENV{DM_NOSCAN}!="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="import_end"
 
 IMPORT{db}="ID_FS_TYPE"
 IMPORT{db}="ID_FS_USAGE"
Signature · 1 line
2.43.2
#2 lore raw
Quoted 4 lines · Benjamin Marzinski
Quoted 2 lines · Martin Wilck
Fixes b3582da ("11-dm-mpath.rules: use import logic like 13-dm-

disk.rules")

Thanks for the quick review, Ben!

FTR: While this is an embarrassing bug in 0.9.8, I think it's real impact is rather low.

First of all, it's not regression wrt earlier releases, because these releases didn't check DM_UDEV_DISABLE_OTHER_RULES_FLAG at this point in the code in the first place.

Secondly, the bug matters only for multipath devices that
- have at least one valid path,
- and have been probed successfully by upper layers before,
- and are suspended at the time the uevent is processed [1].

In this case, some udev properties will be missing in later rules because we mistakenly don't import them from the db. For systems with recent lvm2 (2.03.19 and later), only ID_FS_TYPE and ID_FS_VERSION will be missing, as the other properties will be imported by 13-dm- disk.rules later; on systems with older lvm2 releases all blkid-derived properties will be missing.

ID_FS_TYPE is an important property. Yet no subsystem I am aware of will destroy an already set-up block device stack because ID_FS_TYPE isn't set any more. AFAIK the only entity that attempts to destroy existing layers is systemd, which does this if it encounters SYSTEMD_READY=0 for a previously activated device. But this does not happen for suspended devices.

In other words, properties like ID_FS_TYPE will be missing after processing an uevent on a suspended device, but that should do no actual harm to the system. When the device is resumed, an uevent will be generated and the missing properties will be reinstated.

Martin

[1] because for dm-multipath, DM_UDEV_DISABLE_OTHER_RULES_FLAG=1 essentially means that the device is suspended.