diff mbox series

[02/11] 11-dm-mpath.rules: don't import DM_NOSCAN from udev db

Message ID 20240324211301.7200-3-mwilck@suse.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show
Series multipath udev rules changes for dm rules V3 | expand

Commit Message

Martin Wilck March 24, 2024, 9:12 p.m. UTC
DM_NOSCAN is our "output" flag for 13-dm-disk.rules, and it should
be treated the same way as DM_UDEV_DISABLE_OTHER_RULES_FLAG, which
isn't imported from the udev database. The state that we need to
remember is MPATH_DEVICE_READY, which we've already imported above,
and we will set the "output" flags accordingly in the "force_activation"
code path further down.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 multipath/11-dm-mpath.rules.in | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Benjamin Marzinski March 26, 2024, 10:03 p.m. UTC | #1
On Sun, Mar 24, 2024 at 10:12:52PM +0100, Martin Wilck wrote:
> DM_NOSCAN is our "output" flag for 13-dm-disk.rules, and it should
> be treated the same way as DM_UDEV_DISABLE_OTHER_RULES_FLAG, which
> isn't imported from the udev database. The state that we need to
> remember is MPATH_DEVICE_READY, which we've already imported above,
> and we will set the "output" flags accordingly in the "force_activation"
> code path further down.
> 
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
>  multipath/11-dm-mpath.rules.in | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in
> index 3f23108..11b5adf 100644
> --- a/multipath/11-dm-mpath.rules.in
> +++ b/multipath/11-dm-mpath.rules.in
> @@ -18,9 +18,11 @@ ACTION=="add", ENV{DM_ACTIVATION}=="1", ENV{DM_SUSPENDED}!="1", ENV{DISK_RO}!="1
>  
>  # If this uevent didn't come from dm, don't try to update the
>  # device state
> +# Note that .MPATH_DEVICE_READY_OLD=="" here. Thus we won't activate the
> +# device below at mpath_is_ready, which is correct.

Do you mean "force_activation" instead of "mpath_is_ready"?

-Ben

>  ENV{DM_COOKIE}!="?*", ENV{DM_ACTION}!="PATH_*", \
> -	IMPORT{db}="DM_NOSCAN", IMPORT{db}="DM_COLDPLUG_SUSPENDED", \
> -	GOTO="scan_import"
> +	IMPORT{db}="DM_COLDPLUG_SUSPENDED", \
> +	GOTO="force_activation"
>  
>  ENV{.MPATH_DEVICE_READY_OLD}="$env{MPATH_DEVICE_READY}"
>  
> -- 
> 2.43.2
Benjamin Marzinski March 27, 2024, 12:14 a.m. UTC | #2
On Tue, Mar 26, 2024 at 06:03:42PM -0400, Benjamin Marzinski wrote:
> On Sun, Mar 24, 2024 at 10:12:52PM +0100, Martin Wilck wrote:
> > DM_NOSCAN is our "output" flag for 13-dm-disk.rules, and it should
> > be treated the same way as DM_UDEV_DISABLE_OTHER_RULES_FLAG, which
> > isn't imported from the udev database. The state that we need to
> > remember is MPATH_DEVICE_READY, which we've already imported above,
> > and we will set the "output" flags accordingly in the "force_activation"
> > code path further down.
> > 
> > Signed-off-by: Martin Wilck <mwilck@suse.com>
> > ---
> >  multipath/11-dm-mpath.rules.in | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in
> > index 3f23108..11b5adf 100644
> > --- a/multipath/11-dm-mpath.rules.in
> > +++ b/multipath/11-dm-mpath.rules.in
> > @@ -18,9 +18,11 @@ ACTION=="add", ENV{DM_ACTIVATION}=="1", ENV{DM_SUSPENDED}!="1", ENV{DISK_RO}!="1
> >  
> >  # If this uevent didn't come from dm, don't try to update the
> >  # device state
> > +# Note that .MPATH_DEVICE_READY_OLD=="" here. Thus we won't activate the
> > +# device below at mpath_is_ready, which is correct.
> 
> Do you mean "force_activation" instead of "mpath_is_ready"?

I see that this label is added two commits later. I don't have a problem
with a comment being confusing for two commits, so if you don't feel
like changing it,

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>

> 
> -Ben
> 
> >  ENV{DM_COOKIE}!="?*", ENV{DM_ACTION}!="PATH_*", \
> > -	IMPORT{db}="DM_NOSCAN", IMPORT{db}="DM_COLDPLUG_SUSPENDED", \
> > -	GOTO="scan_import"
> > +	IMPORT{db}="DM_COLDPLUG_SUSPENDED", \
> > +	GOTO="force_activation"
> >  
> >  ENV{.MPATH_DEVICE_READY_OLD}="$env{MPATH_DEVICE_READY}"
> >  
> > -- 
> > 2.43.2
>
Martin Wilck April 4, 2024, 1:49 p.m. UTC | #3
On Tue, 2024-03-26 at 20:14 -0400, Benjamin Marzinski wrote:
> On Tue, Mar 26, 2024 at 06:03:42PM -0400, Benjamin Marzinski wrote:
> > On Sun, Mar 24, 2024 at 10:12:52PM +0100, Martin Wilck wrote:
> > > DM_NOSCAN is our "output" flag for 13-dm-disk.rules, and it
> > > should
> > > be treated the same way as DM_UDEV_DISABLE_OTHER_RULES_FLAG,
> > > which
> > > isn't imported from the udev database. The state that we need to
> > > remember is MPATH_DEVICE_READY, which we've already imported
> > > above,
> > > and we will set the "output" flags accordingly in the
> > > "force_activation"
> > > code path further down.
> > > 
> > > Signed-off-by: Martin Wilck <mwilck@suse.com>
> > > ---
> > >  multipath/11-dm-mpath.rules.in | 6 ++++--
> > >  1 file changed, 4 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-
> > > mpath.rules.in
> > > index 3f23108..11b5adf 100644
> > > --- a/multipath/11-dm-mpath.rules.in
> > > +++ b/multipath/11-dm-mpath.rules.in
> > > @@ -18,9 +18,11 @@ ACTION=="add", ENV{DM_ACTIVATION}=="1",
> > > ENV{DM_SUSPENDED}!="1", ENV{DISK_RO}!="1
> > >  
> > >  # If this uevent didn't come from dm, don't try to update the
> > >  # device state
> > > +# Note that .MPATH_DEVICE_READY_OLD=="" here. Thus we won't
> > > activate the
> > > +# device below at mpath_is_ready, which is correct.
> > 
> > Do you mean "force_activation" instead of "mpath_is_ready"?
> 
> I see that this label is added two commits later. I don't have a
> problem
> with a comment being confusing for two commits, so if you don't feel
> like changing it,

Good catch, thanks. A few too many rebases, I guess. I will fix it.

Martin

> 
> Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
> 
> > 
> > -Ben
> > 
> > >  ENV{DM_COOKIE}!="?*", ENV{DM_ACTION}!="PATH_*", \
> > > -	IMPORT{db}="DM_NOSCAN",
> > > IMPORT{db}="DM_COLDPLUG_SUSPENDED", \
> > > -	GOTO="scan_import"
> > > +	IMPORT{db}="DM_COLDPLUG_SUSPENDED", \
> > > +	GOTO="force_activation"
> > >  
> > >  ENV{.MPATH_DEVICE_READY_OLD}="$env{MPATH_DEVICE_READY}"
> > >  
> > > -- 
> > > 2.43.2
> > 
>
diff mbox series

Patch

diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in
index 3f23108..11b5adf 100644
--- a/multipath/11-dm-mpath.rules.in
+++ b/multipath/11-dm-mpath.rules.in
@@ -18,9 +18,11 @@  ACTION=="add", ENV{DM_ACTIVATION}=="1", ENV{DM_SUSPENDED}!="1", ENV{DISK_RO}!="1
 
 # If this uevent didn't come from dm, don't try to update the
 # device state
+# Note that .MPATH_DEVICE_READY_OLD=="" here. Thus we won't activate the
+# device below at mpath_is_ready, which is correct.
 ENV{DM_COOKIE}!="?*", ENV{DM_ACTION}!="PATH_*", \
-	IMPORT{db}="DM_NOSCAN", IMPORT{db}="DM_COLDPLUG_SUSPENDED", \
-	GOTO="scan_import"
+	IMPORT{db}="DM_COLDPLUG_SUSPENDED", \
+	GOTO="force_activation"
 
 ENV{.MPATH_DEVICE_READY_OLD}="$env{MPATH_DEVICE_READY}"