summaryrefslogtreecommitdiffstats
path: root/msg.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix all the confusion over directories once and for all. We now haveDoug Ledford2010-04-131-1/+1
| | | | | | | | | | | | 3 directory definitions: mdmon directory for its pid and sock files, mdmonitor directory which is for the mdadm monitor mode pid file and can only be passed in via command line, and the directory for the mdadm map file. Only the mdadm map file still hunts multiple locations, and the number of locations has been reduced to /var/run and the compile time specified location. I could see lowering that to just 1 location, but I didn't do that with this patch. Signed-off-by: Doug Ledford <dledford@redhat.com>
* fix mdmon takeoverLuca Berra2010-03-031-1/+1
| | | | | | | | | | | - when we waited for the old mdmon to exit, we didn't look for the socket in the right place - when we failed to find a pid file, we returned the wrong value (code expected <0, but got ==0). Signed-off-by: Luca Berra <bluca@comedia.it> Signed-off-by: NeilBrown <neilb@suse.de>
* mdmon: allow pid to be stored in different directory.NeilBrown2010-02-041-1/+1
| | | | | | | | /var/run probably doesn't persist from early boot. So if necessary, store in in /lib/init/rw or somewhere else that does persist. Signed-off-by: NeilBrown <neilb@suse.de>
* mdmon: preserve socket over chrootDan Williams2009-10-131-3/+11
| | | | | | | | | | Connect to the monitor in the old namespace and use that connection for WaitClean requests when stopping the victim mdmon instance. This allows ping_monitor() to work post chroot(). Cc: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* ping_manager() to prevent 'add' before 'remove' completesDan Williams2008-09-151-4/+29
| | | | | | | | | | | | It is currently possible to remove a device and re-add it without the manager noticing, i.e. without detecting a mdstat->devcnt container->devcnt mismatch. Introduce ping_manager() to arrange for mdmon to run manage_container() prior to mdadm dropping the exclusive open() on the container. Despite these precautions sysfs_read() may still fail. If this happens invalidate container->devcnt to ensure manage_container() runs at the next event. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Add ping_monitor() to mdadm --waitDan Williams2008-09-151-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The action we are waiting for may not be complete until the monitor has had a chance to take action on the result. The following script can now remove the device on the first attempt, versus a few attempts with the original Wait(): #!/bin/bash #export MDADM_NO_MDMON=1 export IMSM_DEVNAME_AS_SERIAL=1 ./mdadm -Ss ./mdadm --zero-superblock /dev/loop[0-3] echo 2 > /proc/sys/dev/raid/speed_limit_max ./mdadm --create /dev/imsm /dev/loop[0-3] -n 4 -e imsm -a md ./mdadm --create /dev/md/r1 /dev/loop[0-3] -n 4 -l 5 --force -a mdp ./mdadm --fail /dev/md/r1 /dev/loop3 ./mdadm --wait /dev/md/r1 x=0 while ! ./mdadm --remove /dev/imsm /dev/loop3 > /dev/null 2>&1 do x=$((x+1)) done echo "removed after $x attempts" ./mdadm --add /dev/imsm /dev/loop3 Include 2 small cleanups: * remove the almost open coded fd2devnum() in Wait() by introducing a new utility routine stat2devnum() * teach connect_monitor() to parse the container device from a subarray string Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* msg: add a timeout to ping_monitorNeilBrown2008-07-181-2/+2
| | | | | | | Though it should never bee needed, having a timeout in ping_monitor is a sensible safeguard. Signed-off-by: Neil Brown <neilb@suse.de>
* Revise message passing code.Neil Brown2008-07-121-141/+90
| | | | More here
* Remove mgr_pipe for communicating from manage to monitor.Neil Brown2008-07-121-1/+1
| | | | | Data is being passed in shared memory, so the pipe is only being use as a wakeup. This can more easily be done with a thread-signal.
* Handle device removal from containerNeil Brown2008-07-121-13/+0
| | | | | | | This really should be done in mdadm, not mdmon. We ensure the device won't be suddenly commited as a hot-spare using O_EXCL, then check the 'holders' sysfs directory to make sure it is only in use once.
* handle Manage_subdevs() for 'external' arraysDan Williams2008-05-151-0/+249
From: Dan Williams <dan.j.williams@intel.com> 1/ Block attempts to add/remove devices from container members 2/ Forward add/remove requests to containers Signed-off-by: Dan Williams <dan.j.williams@intel.com>