[PATCH] Fix regression during add devices

From
Coly Li <hidden>
Date
2016-03-09 05:20:18
From: Hannes Reinecke <hare@suse.de>

Commit d180d2aa2a17 ("Manage: fix test for 'is array failed'.")
introduced a regression which would not allow to re-add new
drivers to a failed array.

The patch is written by Hannes Reinecke, Neil Brown points out
the buggy commit ID is d180d2aa2a17. Coly helps to submit the
patch to mdadm upstream.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Cc: Coly Li <redacted>
Cc: Neil Brown <redacted>
---
 Manage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Manage.c b/Manage.c
index 7e1b94b..073ddb9 100644
--- a/Manage.c
+++ b/Manage.c
@@ -879,10 +879,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);
-- 
2.6.2
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help