diff mbox series

11-dm-mpath.rules: fix misspelled DM_UDEV_DISABLE_OTHER_RULES_FLAG

Message ID 20240301172514.7262-1-mwilck@suse.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show
Series 11-dm-mpath.rules: fix misspelled DM_UDEV_DISABLE_OTHER_RULES_FLAG | expand

Commit Message

Martin Wilck March 1, 2024, 5:25 p.m. UTC
Fixes: b3582da ("11-dm-mpath.rules: use import logic like 13-dm-disk.rules")
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 multipath/11-dm-mpath.rules.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Benjamin Marzinski March 1, 2024, 6:16 p.m. UTC | #1
On Fri, Mar 01, 2024 at 06:25:14PM +0100, Martin Wilck wrote:
> Fixes: b3582da ("11-dm-mpath.rules: use import logic like 13-dm-disk.rules")
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
>  multipath/11-dm-mpath.rules.in | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in
> index d364f9b..d9585ab 100644
> --- a/multipath/11-dm-mpath.rules.in
> +++ b/multipath/11-dm-mpath.rules.in
> @@ -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"
> -- 
> 2.43.2
Martin Wilck March 1, 2024, 7:20 p.m. UTC | #2
On Fri, 2024-03-01 at 13:16 -0500, Benjamin Marzinski wrote:
> On Fri, Mar 01, 2024 at 06:25:14PM +0100, Martin Wilck wrote:
> > Fixes: b3582da ("11-dm-mpath.rules: use import logic like 13-dm-
> > disk.rules")
> Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>

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.
diff mbox series

Patch

diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in
index d364f9b..d9585ab 100644
--- a/multipath/11-dm-mpath.rules.in
+++ b/multipath/11-dm-mpath.rules.in
@@ -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"