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

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