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

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