Skip to contentSkip to conversation

Monitor: Include containers in spare migration

PATCH Applied Mariusz Tkaczyk 2 participants 2 messages Aug 16, 2017 MD RAID

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Monitor: Include containers in spare migration

Spare migration doesn't work for external metadata. mdadm skips a container with spare device because it is inactive. It used to work because GET_ARRAY_INFO ioctl returned valid structure for a container and mdadm treated such response as active container. Current implementation checks it in sysfs where container is shown as inactive.

Adapt sysfs implementation to work the same way as ioctl.

---
 Monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Monitor.c +1 -1
index f70e5b5..497e364 100644
@@ -497,7 +497,7 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat,
 	if (mse->level == NULL)
 		is_container = 1;
 
-	if (!md_array_active(fd))
+	if (!is_container && !md_array_active(fd))
 		goto disappeared;
 
 	fcntl(fd, F_SETFD, FD_CLOEXEC);
Signature · 1 line
1.8.3.1
Applied
#1 lore raw
Quoted 6 lines · Mariusz Tkaczyk

Spare migration doesn't work for external metadata. mdadm skips a container with spare device because it is inactive. It used to work because GET_ARRAY_INFO ioctl returned valid structure for a container and mdadm treated such response as active container. Current implementation checks it in sysfs where container is shown as inactive.

Quoted 6 lines

Adapt sysfs implementation to work the same way as ioctl.

---
  Monitor.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Applied!

Thanks,
Jes