Blame SOURCES/0008-mdadm-Update-config-man-regarding-default-files-and-.patch

cd8c44
From 24e075c659d0a8718aabefe5af4c97195a188af7 Mon Sep 17 00:00:00 2001
cd8c44
From: Lukasz Florczak <lukasz.florczak@linux.intel.com>
cd8c44
Date: Fri, 18 Mar 2022 09:26:06 +0100
cd8c44
Subject: [PATCH 08/12] mdadm: Update config man regarding default files and
cd8c44
 multi-keyword behavior
cd8c44
cd8c44
Simplify default and alternative config file and directory location references
cd8c44
from mdadm(8) as references to mdadm.conf(5). Add FILE section in config man
cd8c44
and explain order and conditions in which default and alternative config files
cd8c44
and directories are used.
cd8c44
cd8c44
Update config man behavior regarding parsing order when multiple keywords/config
cd8c44
files are involved.
cd8c44
cd8c44
Signed-off-by: Lukasz Florczak <lukasz.florczak@linux.intel.com>
cd8c44
Acked-by: Coly Li <colyli@suse.de>
cd8c44
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
cd8c44
---
cd8c44
 mdadm.8.in      | 30 +++++++++--------------
cd8c44
 mdadm.conf.5.in | 65 ++++++++++++++++++++++++++++++++++++++++++++-----
cd8c44
 2 files changed, 71 insertions(+), 24 deletions(-)
cd8c44
cd8c44
diff --git a/mdadm.8.in b/mdadm.8.in
cd8c44
index 8b21ffd4..0be02e4a 100644
cd8c44
--- a/mdadm.8.in
cd8c44
+++ b/mdadm.8.in
cd8c44
@@ -266,14 +266,11 @@ the exact meaning of this option in different contexts.
cd8c44
 
cd8c44
 .TP
cd8c44
 .BR \-c ", " \-\-config=
cd8c44
-Specify the config file or directory.  Default is to use
cd8c44
-.B {CONFFILE}
cd8c44
-and
cd8c44
-.BR {CONFFILE}.d ,
cd8c44
-or if those are missing then
cd8c44
-.B {CONFFILE2}
cd8c44
-and
cd8c44
-.BR {CONFFILE2}.d .
cd8c44
+Specify the config file or directory.  If not specified, default config file
cd8c44
+and default conf.d directory will be used.  See
cd8c44
+.BR mdadm.conf (5)
cd8c44
+for more details.
cd8c44
+
cd8c44
 If the config file given is
cd8c44
 .B "partitions"
cd8c44
 then nothing will be read, but
cd8c44
@@ -2013,11 +2010,9 @@ The config file is only used if explicitly named with
cd8c44
 .B \-\-config
cd8c44
 or requested with (a possibly implicit)
cd8c44
 .BR \-\-scan .
cd8c44
-In the later case,
cd8c44
-.B {CONFFILE}
cd8c44
-or
cd8c44
-.B {CONFFILE2}
cd8c44
-is used.
cd8c44
+In the later case, default config file is used.  See
cd8c44
+.BR mdadm.conf (5)
cd8c44
+for more details.
cd8c44
 
cd8c44
 If
cd8c44
 .B \-\-scan
cd8c44
@@ -3346,16 +3341,15 @@ on Monitor mode.
cd8c44
 
cd8c44
 .SS {CONFFILE} (or {CONFFILE2})
cd8c44
 
cd8c44
-The config file lists which devices may be scanned to see if
cd8c44
-they contain MD super block, and gives identifying information
cd8c44
-(e.g. UUID) about known MD arrays.  See
cd8c44
+Default config file.  See
cd8c44
 .BR mdadm.conf (5)
cd8c44
 for more details.
cd8c44
 
cd8c44
 .SS {CONFFILE}.d (or {CONFFILE2}.d)
cd8c44
 
cd8c44
-A directory containing configuration files which are read in lexical
cd8c44
-order.
cd8c44
+Default directory containing configuration files.  See
cd8c44
+.BR mdadm.conf (5)
cd8c44
+for more details.
cd8c44
 
cd8c44
 .SS {MAP_PATH}
cd8c44
 When
cd8c44
diff --git a/mdadm.conf.5.in b/mdadm.conf.5.in
cd8c44
index 83edd008..dd331a6a 100644
cd8c44
--- a/mdadm.conf.5.in
cd8c44
+++ b/mdadm.conf.5.in
cd8c44
@@ -88,7 +88,8 @@ but only the major and minor device numbers.  It scans
cd8c44
 .I /dev
cd8c44
 to find the name that matches the numbers.
cd8c44
 
cd8c44
-If no DEVICE line is present, then "DEVICE partitions containers" is assumed.
cd8c44
+If no DEVICE line is present in any config file,
cd8c44
+then "DEVICE partitions containers" is assumed.
cd8c44
 
cd8c44
 For example:
cd8c44
 .IP
cd8c44
@@ -272,6 +273,10 @@ catenated with spaces to form the address.
cd8c44
 Note that this value cannot be set via the
cd8c44
 .I mdadm
cd8c44
 commandline.  It is only settable via the config file.
cd8c44
+There should only be one
cd8c44
+.B MAILADDR
cd8c44
+line and it should have only one address.  Any subsequent addresses
cd8c44
+are silently ignored.
cd8c44
 
cd8c44
 .TP
cd8c44
 .B PROGRAM
cd8c44
@@ -286,7 +291,8 @@ device.
cd8c44
 
cd8c44
 There should only be one
cd8c44
 .B program
cd8c44
-line and it should be give only one program.
cd8c44
+line and it should be given only one program.  Any subsequent programs
cd8c44
+are silently ignored.
cd8c44
 
cd8c44
 
cd8c44
 .TP
cd8c44
@@ -295,7 +301,14 @@ The
cd8c44
 .B create
cd8c44
 line gives default values to be used when creating arrays, new members
cd8c44
 of arrays, and device entries for arrays.
cd8c44
-These include:
cd8c44
+
cd8c44
+There should only be one
cd8c44
+.B create
cd8c44
+line.  Any subsequent lines will override the previous settings.
cd8c44
+
cd8c44
+Keywords used in the
cd8c44
+.I CREATE
cd8c44
+line and supported values are:
cd8c44
 
cd8c44
 .RS 4
cd8c44
 .TP
cd8c44
@@ -475,8 +488,8 @@ The known metadata types are
cd8c44
 
cd8c44
 .B AUTO
cd8c44
 should be given at most once.  Subsequent lines are silently ignored.
cd8c44
-Thus an earlier config file in a config directory will over-ride
cd8c44
-the setting in a later config file.
cd8c44
+Thus a later config file in a config directory will not overwrite
cd8c44
+the setting in an earlier config file.
cd8c44
 
cd8c44
 .TP
cd8c44
 .B POLICY
cd8c44
@@ -594,6 +607,7 @@ The
cd8c44
 line lists custom values of MD device's sysfs attributes which will be
cd8c44
 stored in sysfs after the array is assembled. Multiple lines are allowed and each
cd8c44
 line has to contain the uuid or the name of the device to which it relates.
cd8c44
+Lines are applied in reverse order.
cd8c44
 .RS 4
cd8c44
 .TP
cd8c44
 .B uuid=
cd8c44
@@ -621,7 +635,46 @@ is running in
cd8c44
 .B \-\-monitor
cd8c44
 mode.
cd8c44
 .B \-d/\-\-delay
cd8c44
-command line argument takes precedence over the config file
cd8c44
+command line argument takes precedence over the config file.
cd8c44
+
cd8c44
+If multiple
cd8c44
+.B MINITORDELAY
cd8c44
+lines are provided, only first non-zero value is considered.
cd8c44
+
cd8c44
+.SH FILES
cd8c44
+
cd8c44
+.SS {CONFFILE}
cd8c44
+
cd8c44
+The default config file location, used when
cd8c44
+.I mdadm
cd8c44
+is running without --config option.
cd8c44
+
cd8c44
+.SS {CONFFILE}.d
cd8c44
+
cd8c44
+The default directory with config files. Used when
cd8c44
+.I mdadm
cd8c44
+is running without --config option, after successful reading of the
cd8c44
+.B {CONFFILE}
cd8c44
+default config file. Files in that directory
cd8c44
+are read in lexical order.
cd8c44
+
cd8c44
+
cd8c44
+.SS {CONFFILE2}
cd8c44
+
cd8c44
+Alternative config file that is read, when
cd8c44
+.I mdadm
cd8c44
+is running without --config option and the
cd8c44
+.B {CONFFILE}
cd8c44
+default config file was not opened successfully.
cd8c44
+
cd8c44
+.SS {CONFFILE2}.d
cd8c44
+
cd8c44
+The alternative directory with config files. Used when
cd8c44
+.I mdadm
cd8c44
+is runninng without --config option, after reading the
cd8c44
+.B {CONFFILE2}
cd8c44
+alternative config file whether it was successful or not. Files in
cd8c44
+that directory are read in lexical order.
cd8c44
 
cd8c44
 .SH EXAMPLE
cd8c44
 DEVICE /dev/sd[bcdjkl]1
cd8c44
-- 
cd8c44
2.31.1
cd8c44