diff options
author | Mariusz Tkaczyk <mariusz.tkaczyk@intel.com> | 2017-11-21 11:30:20 +0100 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2017-11-21 19:26:09 +0100 |
commit | 1ea0462990c466d9ffd25d149fa6e983b8834b30 (patch) | |
tree | e6a6d350ffdac79794064a43f9ee07d4b7647894 | |
parent | sysfs: include faulty drive in disk count (diff) | |
download | mdadm-1ea0462990c466d9ffd25d149fa6e983b8834b30.tar.xz mdadm-1ea0462990c466d9ffd25d149fa6e983b8834b30.zip |
Monitor/msg: Don't print error message if mdmon doesn't run
Commit 4515fb28a53a ("Add detail information when can not connect
monitor") was added to warn about failed connection to monitor in
WaitClean function (see link below).
Mdmon runs for IMSM containers when they have array with redundancy so
if mdmon doesn't run, mdadm prints this error. This is misleading and
unnecessary. Just print it in WaitClean function.
The sock in WaitClean is deprecated so it is removed.
Link: https://bugzilla.redhat.com/show_bug.cgi?id=1375002
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
-rw-r--r-- | Monitor.c | 9 | ||||
-rw-r--r-- | mdadm.c | 4 | ||||
-rw-r--r-- | mdadm.h | 2 | ||||
-rw-r--r-- | msg.c | 2 |
4 files changed, 8 insertions, 9 deletions
@@ -1058,7 +1058,7 @@ int Wait(char *dev) static char *clean_states[] = { "clear", "inactive", "readonly", "read-auto", "clean", NULL }; -int WaitClean(char *dev, int sock, int verbose) +int WaitClean(char *dev, int verbose) { int fd; struct mdinfo *mdi; @@ -1125,15 +1125,16 @@ int WaitClean(char *dev, int sock, int verbose) } if (rv < 0) rv = 1; - else if (fping_monitor(sock) == 0 || - ping_monitor(mdi->text_version) == 0) { + else if (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 */ rv = 0; - } else + } else { rv = 1; + pr_err("Error connecting monitor with %s\n", dev); + } if (rv && verbose) pr_err("Error waiting for %s to be clean\n", dev); @@ -1863,7 +1863,7 @@ static int misc_scan(char devmode, struct context *c) if (devmode == 'D') rv |= Detail(name, c); else - rv |= WaitClean(name, -1, c->verbose); + rv |= WaitClean(name, c->verbose); put_md_name(name); } } @@ -1954,7 +1954,7 @@ static int misc_list(struct mddev_dev *devlist, rv |= Wait(dv->devname); continue; case Waitclean: - rv |= WaitClean(dv->devname, -1, c->verbose); + rv |= WaitClean(dv->devname, c->verbose); continue; case KillSubarray: rv |= Kill_subarray(dv->devname, c->subarray, c->verbose); @@ -1395,7 +1395,7 @@ extern int Kill(char *dev, struct supertype *st, int force, int verbose, int noe extern int Kill_subarray(char *dev, char *subarray, int verbose); extern int Update_subarray(char *dev, char *subarray, char *update, struct mddev_ident *ident, int quiet); extern int Wait(char *dev); -extern int WaitClean(char *dev, int sock, int verbose); +extern int WaitClean(char *dev, int verbose); extern int SetAction(char *dev, char *action); extern int Incremental(struct mddev_dev *devlist, struct context *c, @@ -171,8 +171,6 @@ int connect_monitor(char *devname) addr.sun_family = PF_LOCAL; strcpy(addr.sun_path, path); if (connect(sfd, (struct sockaddr*)&addr, sizeof(addr)) < 0) { - pr_err("Error connecting monitor with %s: %s\n", - addr.sun_path, strerror(errno)); close(sfd); return -1; } |