dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

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

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