From 5308f11727b889965efe5ac0e854d197c2b51f6d Mon Sep 17 00:00:00 2001 From: Artur Paszkiewicz Date: Wed, 29 Mar 2017 11:54:15 +0200 Subject: Generic support for --consistency-policy and PPL Add a new parameter to mdadm: --consistency-policy=. It determines how the array maintains consistency in case of unexpected shutdown. This maps to the md sysfs attribute 'consistency_policy'. It can be used to create a raid5 array using PPL. Add the necessary plumbing to pass this option to metadata handlers. The write journal and bitmap functionalities are treated as different policies, which are implicitly selected when using --write-journal or --bitmap options. Signed-off-by: Artur Paszkiewicz Signed-off-by: Jes Sorensen --- sysfs.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'sysfs.c') diff --git a/sysfs.c b/sysfs.c index b0657a04..53589a76 100644 --- a/sysfs.c +++ b/sysfs.c @@ -242,6 +242,17 @@ struct mdinfo *sysfs_read(int fd, char *devnm, unsigned long options) } else sra->sysfs_array_state[0] = 0; + if (options & GET_CONSISTENCY_POLICY) { + strcpy(base, "consistency_policy"); + if (load_sys(fname, buf, sizeof(buf))) { + sra->consistency_policy = CONSISTENCY_POLICY_UNKNOWN; + } else { + sra->consistency_policy = map_name(consistency_policies, buf); + if (sra->consistency_policy == UnSet) + sra->consistency_policy = CONSISTENCY_POLICY_UNKNOWN; + } + } + if (! (options & GET_DEVS)) return sra; -- cgit v1.2.3