dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

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

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