diff mbox series

[09/11] 11-dm-mpath.rules: simplify PATH_FAILED case

Message ID 20240324211301.7200-10-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
This combination of a GOTO and a simple rule can be combined
into a single rule.

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

Comments

Benjamin Marzinski March 27, 2024, 12:04 a.m. UTC | #1
On Sun, Mar 24, 2024 at 10:12:59PM +0100, Martin Wilck wrote:
> This combination of a GOTO and a simple rule can be combined
> into a single rule.
> 
> Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
> ---
>  multipath/11-dm-mpath.rules.in | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in
> index 8833e08..2285853 100644
> --- a/multipath/11-dm-mpath.rules.in
> +++ b/multipath/11-dm-mpath.rules.in
> @@ -56,14 +56,10 @@ PROGRAM=="@BINDIR@/multipath -U -v1 %k", GOTO="paths_ok"
>  ENV{MPATH_DEVICE_READY}="0", GOTO="mpath_action"
>  LABEL="paths_ok"
>  
> -# Don't mark a device ready on a PATH_FAILED event. even if
> -# DM_NR_VALID_PATHS is greater than 0. Just keep the existing
> -# value
> -ENV{DM_ACTION}=="PATH_FAILED", GOTO="mpath_action"
> -
> -# This event is either a PATH_REINSTATED or a table reload where
> -# there are active paths. Mark the device ready
> -ENV{MPATH_DEVICE_READY}="1"
> +# For PATH_FAILED events, keep the existing value of MPATH_DEVICE_READY.
> +# If it's not PATH_FAILED, this event is either a PATH_REINSTATED or a
> +# table reload where there are active paths. Mark the device ready.
> +ENV{DM_ACTION}!="PATH_FAILED", ENV{MPATH_DEVICE_READY}="1"
>  
>  LABEL="mpath_action"
>  
> -- 
> 2.43.2
diff mbox series

Patch

diff --git a/multipath/11-dm-mpath.rules.in b/multipath/11-dm-mpath.rules.in
index 8833e08..2285853 100644
--- a/multipath/11-dm-mpath.rules.in
+++ b/multipath/11-dm-mpath.rules.in
@@ -56,14 +56,10 @@  PROGRAM=="@BINDIR@/multipath -U -v1 %k", GOTO="paths_ok"
 ENV{MPATH_DEVICE_READY}="0", GOTO="mpath_action"
 LABEL="paths_ok"
 
-# Don't mark a device ready on a PATH_FAILED event. even if
-# DM_NR_VALID_PATHS is greater than 0. Just keep the existing
-# value
-ENV{DM_ACTION}=="PATH_FAILED", GOTO="mpath_action"
-
-# This event is either a PATH_REINSTATED or a table reload where
-# there are active paths. Mark the device ready
-ENV{MPATH_DEVICE_READY}="1"
+# For PATH_FAILED events, keep the existing value of MPATH_DEVICE_READY.
+# If it's not PATH_FAILED, this event is either a PATH_REINSTATED or a
+# table reload where there are active paths. Mark the device ready.
+ENV{DM_ACTION}!="PATH_FAILED", ENV{MPATH_DEVICE_READY}="1"
 
 LABEL="mpath_action"