summaryrefslogtreecommitdiffstats
path: root/sysfs.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2009-10-13 17:37:02 -0700
committerDan Williams <dan.j.williams@intel.com>2009-10-13 17:41:58 -0700
commit9f1da8242161ba684f2867f211eb7e9d4baa84bb (patch)
treee396bffdec4ef5915f4eb138f343809431042dc0 /sysfs.c
parentb928b5a0384e7181425a282a0586cbbb3c85fbc3 (diff)
downloadmdadm-9f1da8242161ba684f2867f211eb7e9d4baa84bb.tar.gz
mdadm-9f1da8242161ba684f2867f211eb7e9d4baa84bb.tar.xz
mdadm-9f1da8242161ba684f2867f211eb7e9d4baa84bb.zip
mdmon: preserve socket over chroot
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>
Diffstat (limited to 'sysfs.c')
-rw-r--r--sysfs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sysfs.c b/sysfs.c
index 81ccb53..d327e3d 100644
--- a/sysfs.c
+++ b/sysfs.c
@@ -764,7 +764,7 @@ int sysfs_unique_holder(int devnum, long rdev)
static char *clean_states[] = {
"clear", "inactive", "readonly", "read-auto", "clean", NULL };
-int WaitClean(char *dev, int verbose)
+int WaitClean(char *dev, int sock, int verbose)
{
int fd;
struct mdinfo *mdi;
@@ -840,7 +840,8 @@ int WaitClean(char *dev, int verbose)
}
if (rv < 0)
rv = 1;
- else if (ping_monitor(mdi->text_version) == 0) {
+ else if (fping_monitor(sock) == 0 ||
+ ping_monitor(mdi->text_version) == 0) {
/* we need to ping to close the window between array
* state transitioning to clean and the metadata being
* marked clean