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

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