Blame SOURCES/0002-Document-PART-POLICY-lines.patch

c8f3db
From 6b6112842030309c297a521918d1a2e982426fa3 Mon Sep 17 00:00:00 2001
c8f3db
From: NeilBrown <neilb@suse.com>
c8f3db
Date: Fri, 9 Nov 2018 17:12:33 +1100
c8f3db
Subject: [RHEL7.7 PATCH 02/21] Document PART-POLICY lines
c8f3db
c8f3db
PART-POLICY has been accepted in mdadm.conf since the same
c8f3db
time that POLICY was accepted, but it was never documented.
c8f3db
So add the missing documentation.
c8f3db
c8f3db
Also fix a bug which would have stopped it from working if
c8f3db
anyone had ever tried to use it.
c8f3db
c8f3db
Signed-off-by: NeilBrown <neilb@suse.com>
c8f3db
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
c8f3db
---
c8f3db
 mdadm.conf.5 | 24 +++++++++++++++++++++++-
c8f3db
 policy.c     |  2 +-
c8f3db
 2 files changed, 24 insertions(+), 2 deletions(-)
c8f3db
c8f3db
diff --git a/mdadm.conf.5 b/mdadm.conf.5
c8f3db
index 18512cb..47c962a 100644
c8f3db
--- a/mdadm.conf.5
c8f3db
+++ b/mdadm.conf.5
c8f3db
@@ -501,7 +501,7 @@ To update hot plug configuration it is necessary to execute
c8f3db
 .B mdadm \-\-udev\-rules
c8f3db
 command after changing the config file
c8f3db
 
c8f3db
-Key words used in the
c8f3db
+Keywords used in the
c8f3db
 .I POLICY
c8f3db
 line and supported values are:
c8f3db
 
c8f3db
@@ -565,6 +565,28 @@ be automatically added to that array (or it's container)
c8f3db
 as above and the disk will become a spare in remaining cases
c8f3db
 .RE
c8f3db
 
c8f3db
+.TP
c8f3db
+.B PART-POLICY
c8f3db
+This is similar to
c8f3db
+.B POLICY
c8f3db
+and accepts the same keyword assignments.  It allows a consistent set
c8f3db
+of policies to applied to each of the partitions of a device.
c8f3db
+
c8f3db
+A
c8f3db
+.B PART-POLICY
c8f3db
+line should set
c8f3db
+.I type=disk
c8f3db
+and identify the path to one or more disk devices.  Each partition on
c8f3db
+these disks will be treated according to the
c8f3db
+.I action=
c8f3db
+setting  from this line.  If a
c8f3db
+.I domain
c8f3db
+is set in the line, then the domain associated with each patition will
c8f3db
+be based on the domain, but with
c8f3db
+.RB \(dq -part N\(dq
c8f3db
+appended, when N is the partition number for the partition that was
c8f3db
+found.
c8f3db
+
c8f3db
 .SH EXAMPLE
c8f3db
 DEVICE /dev/sd[bcdjkl]1
c8f3db
 .br
c8f3db
diff --git a/policy.c b/policy.c
c8f3db
index c0d18a7..258f393 100644
c8f3db
--- a/policy.c
c8f3db
+++ b/policy.c
c8f3db
@@ -300,7 +300,7 @@ static int path_has_part(char *path, char **part)
c8f3db
 		l--;
c8f3db
 	if (l < 5 || strncmp(path+l-5, "-part", 5) != 0)
c8f3db
 		return 0;
c8f3db
-	*part = path+l-4;
c8f3db
+	*part = path+l-5;
c8f3db
 	return 1;
c8f3db
 }
c8f3db
 
c8f3db
-- 
c8f3db
2.7.5
c8f3db