* [PATCH 1/1] mdadm/udev: Don't add member disk if super is disabled in conf file
@ 2023-10-17 5:48 Xiao Ni
2023-10-17 7:56 ` Mariusz Tkaczyk
0 siblings, 1 reply; 3+ messages in thread
From: Xiao Ni @ 2023-10-17 5:48 UTC (permalink / raw)
To: jes; +Cc: mariusz.tkaczyk, colyli, linux-raid
Superblocks can be disabled behind AUTO in mdadm.conf. For this situation udev
rule still can handle the member disk. But it's not expected. Change the udev
rule to check the conf file before handling member disk.
Signed-off-by: Xiao Ni <xni@redhat.com>
---
udev-md-raid-assembly.rules | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/udev-md-raid-assembly.rules b/udev-md-raid-assembly.rules
index d4a7f0a5a049..a0f9494f4461 100644
--- a/udev-md-raid-assembly.rules
+++ b/udev-md-raid-assembly.rules
@@ -16,6 +16,10 @@ ENV{SYSTEMD_READY}=="0", GOTO="md_inc_end"
# Then the change event happens.
# When adding md/dm devices, ID_FS_TYPE can only be linux_raid_member
# after change event happens.
+ENV{ID_FS_TYPE}=="linux_raid_member", \
+ PROGRAM="/usr/bin/egrep -c ^AUTO.*+1\.x.*-1\.x.*$ /etc/mdadm.conf", GOTO="md_inc"
+ENV{ID_FS_TYPE}=="linux_raid_member", \
+ PROGRAM="/usr/bin/egrep -c ^AUTO.*-1\.x.*$ /etc/mdadm.conf", GOTO="md_inc_end"
ENV{ID_FS_TYPE}=="linux_raid_member", GOTO="md_inc"
# "noiswmd" on kernel command line stops mdadm from handling
@@ -26,9 +30,20 @@ IMPORT{cmdline}="noiswmd"
IMPORT{cmdline}="nodmraid"
ENV{nodmraid}=="?*", GOTO="md_inc_end"
+
+ENV{ID_FS_TYPE}=="ddf_raid_member", \
+ PROGRAM="/usr/bin/egrep -c ^AUTO.*+ddf.*-ddf.*$ /etc/mdadm.conf", GOTO="md_inc"
+ENV{ID_FS_TYPE}=="ddf_raid_member", \
+ PROGRAM="/usr/bin/egrep -c ^AUTO.*-ddf.*$ /etc/mdadm.conf", GOTO="md_inc_end"
ENV{ID_FS_TYPE}=="ddf_raid_member", GOTO="md_inc"
+
ENV{noiswmd}=="?*", GOTO="md_inc_end"
+ENV{ID_FS_TYPE}=="isw_raid_member", \
+ PROGRAM="/usr/bin/egrep -c ^AUTO.*+imsm.*-imsm.*$ /etc/mdadm.conf", GOTO="md_inc"
+ENV{ID_FS_TYPE}=="isw_raid_member", \
+ PROGRAM="/usr/bin/egrep -c ^AUTO.*-imsm.*$ /etc/mdadm.conf", GOTO="md_inc_end"
ENV{ID_FS_TYPE}=="isw_raid_member", ACTION!="change", GOTO="md_inc"
+
GOTO="md_inc_end"
LABEL="md_inc"
--
2.32.0 (Apple Git-132)
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH 1/1] mdadm/udev: Don't add member disk if super is disabled in conf file
2023-10-17 5:48 [PATCH 1/1] mdadm/udev: Don't add member disk if super is disabled in conf file Xiao Ni
@ 2023-10-17 7:56 ` Mariusz Tkaczyk
2023-10-17 11:29 ` Mariusz Tkaczyk
0 siblings, 1 reply; 3+ messages in thread
From: Mariusz Tkaczyk @ 2023-10-17 7:56 UTC (permalink / raw)
To: Xiao Ni; +Cc: jes, colyli, linux-raid
On Tue, 17 Oct 2023 13:48:48 +0800
Xiao Ni <xni@redhat.com> wrote:
> Superblocks can be disabled behind AUTO in mdadm.conf. For this situation udev
> rule still can handle the member disk. But it's not expected. Change the udev
> rule to check the conf file before handling member disk.
>
Hi Xiao,
I'm reading manual and for me it is something that should gone. Why we need
this? Kernel is responsible for bringing up partitions, not udev.
https://linux.die.net/man/5/mdadm.conf
"From 2.6.28 all md array devices are partitionable, hence this option is not
needed."
I need from you to deeply understand this feature, why it was needed, what it
gives now to help community take a decision what is the right thing to do.
I would prefer to ask mdadm to provide such option from config. You
cannot simply assume that /etc/mdadm.conf is the right conf location. To not
make it over complicated and bug friendly we should get this by mdadm. mdadm
has conf file location determination so that should guarantee it is always
the same value.
Thanks,
Mariusz
> Signed-off-by: Xiao Ni <xni@redhat.com>
> ---
> udev-md-raid-assembly.rules | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/udev-md-raid-assembly.rules b/udev-md-raid-assembly.rules
> index d4a7f0a5a049..a0f9494f4461 100644
> --- a/udev-md-raid-assembly.rules
> +++ b/udev-md-raid-assembly.rules
> @@ -16,6 +16,10 @@ ENV{SYSTEMD_READY}=="0", GOTO="md_inc_end"
> # Then the change event happens.
> # When adding md/dm devices, ID_FS_TYPE can only be linux_raid_member
> # after change event happens.
> +ENV{ID_FS_TYPE}=="linux_raid_member", \
> + PROGRAM="/usr/bin/egrep -c ^AUTO.*+1\.x.*-1\.x.*$ /etc/mdadm.conf",
> GOTO="md_inc" +ENV{ID_FS_TYPE}=="linux_raid_member", \
> + PROGRAM="/usr/bin/egrep -c ^AUTO.*-1\.x.*$ /etc/mdadm.conf",
> GOTO="md_inc_end" ENV{ID_FS_TYPE}=="linux_raid_member", GOTO="md_inc"
>
> # "noiswmd" on kernel command line stops mdadm from handling
> @@ -26,9 +30,20 @@ IMPORT{cmdline}="noiswmd"
> IMPORT{cmdline}="nodmraid"
>
> ENV{nodmraid}=="?*", GOTO="md_inc_end"
> +
> +ENV{ID_FS_TYPE}=="ddf_raid_member", \
> + PROGRAM="/usr/bin/egrep -c ^AUTO.*+ddf.*-ddf.*$ /etc/mdadm.conf",
> GOTO="md_inc" +ENV{ID_FS_TYPE}=="ddf_raid_member", \
> + PROGRAM="/usr/bin/egrep -c ^AUTO.*-ddf.*$ /etc/mdadm.conf",
> GOTO="md_inc_end" ENV{ID_FS_TYPE}=="ddf_raid_member", GOTO="md_inc"
> +
> ENV{noiswmd}=="?*", GOTO="md_inc_end"
> +ENV{ID_FS_TYPE}=="isw_raid_member", \
> + PROGRAM="/usr/bin/egrep -c ^AUTO.*+imsm.*-imsm.*$ /etc/mdadm.conf",
> GOTO="md_inc" +ENV{ID_FS_TYPE}=="isw_raid_member", \
> + PROGRAM="/usr/bin/egrep -c ^AUTO.*-imsm.*$ /etc/mdadm.conf",
> GOTO="md_inc_end" ENV{ID_FS_TYPE}=="isw_raid_member", ACTION!="change",
> GOTO="md_inc" +
> GOTO="md_inc_end"
For sure IMSM does not support it.
Thanks,
Mariusz
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH 1/1] mdadm/udev: Don't add member disk if super is disabled in conf file
2023-10-17 7:56 ` Mariusz Tkaczyk
@ 2023-10-17 11:29 ` Mariusz Tkaczyk
0 siblings, 0 replies; 3+ messages in thread
From: Mariusz Tkaczyk @ 2023-10-17 11:29 UTC (permalink / raw)
To: Xiao Ni; +Cc: jes, colyli, linux-raid
On Tue, 17 Oct 2023 09:56:15 +0200
Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> wrote:
> I'm reading manual and for me it is something that should gone. Why we need
> this? Kernel is responsible for bringing up partitions, not udev.
> https://linux.die.net/man/5/mdadm.conf
>
> "From 2.6.28 all md array devices are partitionable, hence this option is not
> needed."
>
> I need from you to deeply understand this feature, why it was needed, what it
> gives now to help community take a decision what is the right thing to do.
Please ignore, I read auto= instead of AUTO.
Mariusz
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-10-17 11:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-17 5:48 [PATCH 1/1] mdadm/udev: Don't add member disk if super is disabled in conf file Xiao Ni
2023-10-17 7:56 ` Mariusz Tkaczyk
2023-10-17 11:29 ` Mariusz Tkaczyk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).