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

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