diff options
author | Dan Williams <dan.j.williams@intel.com> | 2009-10-14 02:41:57 +0200 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-10-14 02:41:57 +0200 |
commit | 96a8270d46faab599b41f1cf78b4331b44c5a6be (patch) | |
tree | f41146da4aaff8df940634b0706ef7f972cd0eb3 /managemon.c | |
parent | Detail: export MD_UUID from mapfile (diff) | |
download | mdadm-96a8270d46faab599b41f1cf78b4331b44c5a6be.tar.xz mdadm-96a8270d46faab599b41f1cf78b4331b44c5a6be.zip |
mdmon: avoid writes in the startup path for mdmon on root arrays
When killing a previous monitor be careful not to cause writes to the
filesystem until the reads necessary to get the monitor operational have
completed.
The code is already prepared for errors creating the pid and socket
files, so simply defer creation of these files until after the first
call to manage().
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'managemon.c')
-rw-r--r-- | managemon.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/managemon.c b/managemon.c index f9d545d4..5958e18e 100644 --- a/managemon.c +++ b/managemon.c @@ -680,6 +680,12 @@ void do_manager(struct supertype *container) read_sock(container); if (container->sock < 0 || socket_hup_requested) { + /* If this fails, we hope it already exists + * pid file lives in /var/run/mdadm/mdXX.pid + */ + mkdir("/var", 0600); + mkdir("/var/run", 0600); + mkdir("/var/run/mdadm", 0600); close(container->sock); container->sock = make_control_sock(container->devname); make_pidfile(container->devname, 0); |