File 0150-Create-fix-regression-in-setting-raid_disk.patch of Package mdadm.5365

From f170a5a9a0b5dbdd502b1014cfe040bf83da5ccf Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.com>
Date: Thu, 14 Jan 2016 13:22:17 +1100
Subject: [PATCH 210/359] Create: fix regression in setting raid_disk
References: bsc#1081910

Recent commit caused 'missing' declarations to not be handled correctly.

Fixes: cc1799c3ddc9 ("Enable create array with write journal (--write-journal DEVICE).")
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Coly Li <colyli@suse.de>

---
 Create.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Create.c b/Create.c
index 21d1374..40f1b7e 100644
--- a/Create.c
+++ b/Create.c
@@ -851,11 +851,14 @@ int Create(struct supertype *st, char *mddev,
 			if (dnum >= total_slots)
 				abort();
 			if (dnum == insert_point) {
+				raid_disk_num += 1;
 				moved_disk = dv;
 				continue;
 			}
-			if (strcasecmp(dv->devname, "missing")==0)
+			if (strcasecmp(dv->devname, "missing")==0) {
+				raid_disk_num += 1;
 				continue;
+			}
 			if (have_container)
 				moved_disk = NULL;
 			if (have_container && dnum < info.array.raid_disks - 1)
-- 
2.16.1

openSUSE Build Service is sponsored by