dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/0033-udev-add-no-devices-option-for-calling-mdadm-detail.patch

5d5466
From 1a52f1fc0266d438c996789d4addbfac999a6139 Mon Sep 17 00:00:00 2001
5d5466
From: Coly Li <colyli@suse.de>
5d5466
Date: Wed, 31 Jul 2019 13:29:30 +0800
5d5466
Subject: [RHEL7.8 PATCH V2 33/47] udev: add --no-devices option for calling
5d5466
 'mdadm --detail'
5d5466
5d5466
When creating symlink of a md raid device, the detailed information of
5d5466
component disks are unnecessary for rule udev-md-raid-arrays.rules. For
5d5466
md raid devices with huge number of component disks (e.g. 1500 DASD
5d5466
disks), the detail information of component devices can be very large
5d5466
and exceed udev monitor's on-stack message buffer.
5d5466
5d5466
This patch adds '--no-devices' option when calling mdadm by,
5d5466
IMPORT{program}="BINDIR/mdadm --detail --no-devices --export $devnode"
5d5466
5d5466
Now the detailed output won't include component disks information,
5d5466
and the error message "invalid message length" reported by systemd can
5d5466
be removed.
5d5466
5d5466
Signed-off-by: Coly Li <colyli@suse.de>
5d5466
Reviewed-by: NeilBrown <neilb@suse.com>
5d5466
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
5d5466
---
5d5466
 udev-md-raid-arrays.rules | 2 +-
5d5466
 1 file changed, 1 insertion(+), 1 deletion(-)
5d5466
5d5466
diff --git a/udev-md-raid-arrays.rules b/udev-md-raid-arrays.rules
5d5466
index 5b99d58..d391665 100644
5d5466
--- a/udev-md-raid-arrays.rules
5d5466
+++ b/udev-md-raid-arrays.rules
5d5466
@@ -17,7 +17,7 @@ TEST!="md/array_state", ENV{SYSTEMD_READY}="0", GOTO="md_end"
5d5466
 ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0", GOTO="md_end"
5d5466
 LABEL="md_ignore_state"
5d5466
 
5d5466
-IMPORT{program}="BINDIR/mdadm --detail --export $devnode"
5d5466
+IMPORT{program}="BINDIR/mdadm --detail --no-devices --export $devnode"
5d5466
 ENV{DEVTYPE}=="disk", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}", OPTIONS+="string_escape=replace"
5d5466
 ENV{DEVTYPE}=="disk", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}"
5d5466
 ENV{DEVTYPE}=="disk", ENV{MD_DEVNAME}=="?*", SYMLINK+="md/$env{MD_DEVNAME}"
5d5466
-- 
5d5466
2.7.5
5d5466