File 0001-Fix-regression-during-add-devices.patch of Package mdadm.1739

From 0b99042f19099054edb7e52e50602750fc04e484 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Tue, 3 Nov 2015 16:42:29 +0100
Subject: [PATCH] Fix regression during add devices

Commit 38aeaf3a introduced a regression which would not allow
to re-add new drives to a failed array.

References: bsc#953380

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Coly Li <colyli@suse.de>
---
 Manage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Manage.c b/Manage.c
index 1cf590a..ed28c1a 100644
--- a/Manage.c
+++ b/Manage.c
@@ -860,10 +860,10 @@ int Manage_add(int fd, int tfd, struct mddev_dev *dv,
 					continue;
 				if (disc.major == 0 && disc.minor == 0)
 					continue;
-				found++;
 				if (!(disc.state & (1<<MD_DISK_SYNC)))
 					continue;
 				avail[disc.raid_disk] = 1;
+				found++;
 			}
 			array_failed = !enough(array->level, array->raid_disks,
 					       array->layout, 1, avail);
-- 
1.8.4.5

openSUSE Build Service is sponsored by