dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/Incremental-Use-md_array_active-where-applicable.patch

2c1b57
From ff4ad24b1c261ab4d286cbe54157d7c588191692 Mon Sep 17 00:00:00 2001
2c1b57
From: Jes Sorensen <jsorensen@fb.com>
2c1b57
Date: Tue, 25 Apr 2017 14:57:46 -0400
2c1b57
Subject: [RHEL7.5 PATCH 098/169] Incremental: Use md_array_active() where
2c1b57
 applicable
2c1b57
2c1b57
md_get_array_info() == 0 implies an array is active, however this is more
2c1b57
correct.
2c1b57
2c1b57
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2c1b57
---
2c1b57
 Incremental.c | 5 ++---
2c1b57
 1 file changed, 2 insertions(+), 3 deletions(-)
2c1b57
2c1b57
diff --git a/Incremental.c b/Incremental.c
2c1b57
index 28f1f77..a351151 100644
2c1b57
--- a/Incremental.c
2c1b57
+++ b/Incremental.c
2c1b57
@@ -403,7 +403,7 @@ int Incremental(struct mddev_dev *devlist, struct context *c,
2c1b57
 		    && ! policy_action_allows(policy, st->ss->name,
2c1b57
 					      act_re_add)
2c1b57
 		    && c->runstop < 1) {
2c1b57
-			if (md_get_array_info(mdfd, &ainf) == 0) {
2c1b57
+			if (md_array_active(mdfd)) {
2c1b57
 				pr_err("not adding %s to active array (without --run) %s\n",
2c1b57
 				       devname, chosen_name);
2c1b57
 				rv = 2;
2c1b57
@@ -667,9 +667,8 @@ static void find_reject(int mdfd, struct supertype *st, struct mdinfo *sra,
2c1b57
 	 * and events less than the passed events, and remove the device.
2c1b57
 	 */
2c1b57
 	struct mdinfo *d;
2c1b57
-	mdu_array_info_t ra;
2c1b57
 
2c1b57
-	if (md_get_array_info(mdfd, &ra) == 0)
2c1b57
+	if (md_array_active(mdfd))
2c1b57
 		return; /* not safe to remove from active arrays
2c1b57
 			 * without thinking more */
2c1b57
 
2c1b57
-- 
2c1b57
2.7.4
2c1b57