dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

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

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