Thread (13 messages) 13 messages, 4 authors, 2022-03-18

Re: [dm-devel] [PATCH] udev-md-raid-assembly.rules: skip if DM_UDEV_DISABLE_OTHER_RULES_FLAG

From: Peter Rajnoha <hidden>
Date: 2022-03-01 07:53:59
Also in: dm-devel

Hi!

On Mon 28 Feb 2022 23:28, Xiao Ni wrote:
Hi Peter

In rhel, we have a rhel only udev rule that checks
DM_UDEV_DISABLE_OTHER_RULES_FLAG. Maybe it's the reason why you don't
notice this. Besides DM_UDEV_DISABLE_OTHER_RULES_FLAG, it still checks
other flags.
Ah yes, that's it! I've been still recalling this to be patched once.
So looks like it just didn't get propagated upstream :-/
# Next make sure that this isn't a dm device we should skip for some reason
ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="dm_change_end"
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="dm_change_end"
ENV{DM_SUSPENDED}=="1", GOTO="dm_change_end"
KERNEL=="dm-*", SUBSYSTEM=="block", ENV{ID_FS_TYPE}=="linux_raid_member", \
        ACTION=="change", RUN+="/sbin/mdadm -I $env{DEVNAME}"
LABEL="dm_change_end"

In 10-dm.rules, if DM_SUSPENDED is 1, it sets
DM_UDEV_DISABLE_OTHER_RULES_FLAG to 1. So we don't need the check of
DM_SUSPENDED. But how DM_UDEV_RULES_VSN? Do we need to check it?
Yes, right, the check for DM_SUSPENDED is superfluous here so we don't
actually need that one. The single check for DM_UDEV_DISABLE_OTHER_RULES_FLAG
covers it.

The DM_UDEV_RULES_VSN - this was meant for future changes in case a new
set of DM udev variables is used or existing set changed so the other rules
know what exact variable set is available for checking. But I think the rules
are settled down for a few years now and I don't expect any more radical
changes here, so we can remove that check for DM_UDEV_RULES_VSN as well.

-- 
Peter
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help