* [PATCH] Monitor: Include containers in spare migration
@ 2017-07-21 12:58 Mariusz Tkaczyk
0 siblings, 0 replies; only message in thread
From: Mariusz Tkaczyk @ 2017-07-21 12:58 UTC (permalink / raw)
To: linux-raid; +Cc: jes.sorensen, Mariusz Tkaczyk
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@intel.com>
Reviewed-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
---
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-07-21 12:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-21 12:58 [PATCH] Monitor: Include containers in spare migration Mariusz Tkaczyk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).