dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

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

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