linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix: mdadm -Ss for external metadata don't stop container
@ 2010-12-07  6:44 Hawrylewicz Czarnowski, Przemyslaw
  2010-12-07 10:16 ` Neil Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Hawrylewicz Czarnowski, Przemyslaw @ 2010-12-07  6:44 UTC (permalink / raw)
  To: Neil Brown
  Cc: linux-raid@vger.kernel.org, Williams, Dan J, Ciechanowski, Ed,
	Labun, Marcin, Czarnowska, Anna

Neil,

The one below is a fix for the problem we encounter quite often when we try to stop all arrays with mdadm -Ss. The main problem is that mdmon holds open container device and then exits. The time that system make clean up is quite long and mdadm invokes ARRAY_STOP ioctl when device is still opened. 
Second resolution is to retry ioctl in mdadm after mdmon exits, but closing handle is I what should be done before process exist.
Take a look at the patch below:

--
Sometimes (~50%) mdadm -Ss cannot stop container as mdmon opens its device
and do not close it before exit(). The period between open and release of
handle is too long and md is not able stop device. Releasing handle before
exit does not block md.

Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
---
 monitor.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/monitor.c b/monitor.c
index 59b4181..f166bc8 100644
--- a/monitor.c
+++ b/monitor.c
@@ -525,6 +525,7 @@ static int wait_and_act(struct supertype *container, int nowait)
 				remove_pidfile(container->devname);
 			exit_now = 1;
 			signal_manager();
+			close(fd);
 			exit(0);
 		}
 	}
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-03-17 21:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-07  6:44 [PATCH] fix: mdadm -Ss for external metadata don't stop container Hawrylewicz Czarnowski, Przemyslaw
2010-12-07 10:16 ` Neil Brown
2010-12-07 11:07   ` Hawrylewicz Czarnowski, Przemyslaw
2010-12-07 16:09     ` Dan Williams
2011-03-16 22:24   ` Hawrylewicz Czarnowski, Przemyslaw
2011-03-17  2:38     ` NeilBrown
2011-03-17 16:51       ` Wojcik, Krzysztof
2011-03-17 21:08         ` Hawrylewicz Czarnowski, Przemyslaw

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).