[PATCH] Monitor: Include containers in spare migration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



md_array_active used GET_ARRAY_INFO ioctl to find out if array is
active. If called for a container, it also returned true as ioctl for
container was successful. sysfs implementation of md_array_active
returns false for container and spare migration for external metadata
doesn't work.

One option would be to make sysfs implementation work the same way as
ioctl implementation, however md_array_active is a misleading function
name to return true for inactive containers. As ioctl implementation is
supposed to be abandoned one day, let's keep different (but correct)
behaviour. Most of the callers of md_array_active don't use it on a
containers anyway so change the only place where it matters.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@xxxxxxxxx>
Reviewed-by: Tomasz Majchrzak <tomasz.majchrzak@xxxxxxxxx>
---
 Monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Monitor.c b/Monitor.c
index 8d753ca..ac9e421 100644
--- a/Monitor.c
+++ b/Monitor.c
@@ -494,7 +494,7 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat,
 
 	is_container = mse->level == NULL;
 
-	if (!md_array_active(fd))
+	if (!is_container && !md_array_active(fd))
 		goto disappeared;
 
 	fcntl(fd, F_SETFD, FD_CLOEXEC);
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux