]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Document PART-POLICY lines
authorNeilBrown <neilb@suse.com>
Fri, 9 Nov 2018 06:12:33 +0000 (17:12 +1100)
committerJes Sorensen <jsorensen@fb.com>
Thu, 6 Dec 2018 12:42:47 +0000 (07:42 -0500)
PART-POLICY has been accepted in mdadm.conf since the same
time that POLICY was accepted, but it was never documented.
So add the missing documentation.

Also fix a bug which would have stopped it from working if
anyone had ever tried to use it.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
mdadm.conf.5
policy.c

index 18512cb0ec7edfe32d0af3ae7f4700c4b8c9cf2b..47c962ab207125646f1cd7df5db25cacec23cf7a 100644 (file)
@@ -501,7 +501,7 @@ To update hot plug configuration it is necessary to execute
 .B mdadm \-\-udev\-rules
 command after changing the config file
 
-Key words used in the
+Keywords used in the
 .I POLICY
 line and supported values are:
 
@@ -565,6 +565,28 @@ be automatically added to that array (or it's container)
 as above and the disk will become a spare in remaining cases
 .RE
 
+.TP
+.B PART-POLICY
+This is similar to
+.B POLICY
+and accepts the same keyword assignments.  It allows a consistent set
+of policies to applied to each of the partitions of a device.
+
+A
+.B PART-POLICY
+line should set
+.I type=disk
+and identify the path to one or more disk devices.  Each partition on
+these disks will be treated according to the
+.I action=
+setting  from this line.  If a
+.I domain
+is set in the line, then the domain associated with each patition will
+be based on the domain, but with
+.RB \(dq -part N\(dq
+appended, when N is the partition number for the partition that was
+found.
+
 .SH EXAMPLE
 DEVICE /dev/sd[bcdjkl]1
 .br
index c0d18a7eca5b18a0d352a4da1bb5b45af96d4079..258f39317951cece91d44997269dc9b045be087e 100644 (file)
--- a/policy.c
+++ b/policy.c
@@ -300,7 +300,7 @@ static int path_has_part(char *path, char **part)
                l--;
        if (l < 5 || strncmp(path+l-5, "-part", 5) != 0)
                return 0;
-       *part = path+l-4;
+       *part = path+l-5;
        return 1;
 }