|
|
3978af |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
3978af |
From: Benjamin Marzinski <bmarzins@redhat.com>
|
|
|
3978af |
Date: Fri, 16 Jul 2021 12:39:17 -0500
|
|
|
3978af |
Subject: [PATCH] multipath: print warning if multipathd is not running.
|
|
|
3978af |
|
|
|
3978af |
If multipath notices that multipath devices exist or were created, and
|
|
|
3978af |
multipathd is not running, it now prints a warning message, so users are
|
|
|
3978af |
notified of the issue.
|
|
|
3978af |
|
|
|
3978af |
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|
|
3978af |
---
|
|
|
3978af |
libmultipath/configure.c | 13 +++++++++++--
|
|
|
3978af |
libmultipath/configure.h | 1 +
|
|
|
3978af |
multipath/main.c | 5 +++++
|
|
|
3978af |
3 files changed, 17 insertions(+), 2 deletions(-)
|
|
|
3978af |
|
|
|
3978af |
diff --git a/libmultipath/configure.c b/libmultipath/configure.c
|
|
|
3978af |
index f24d9283..9c8d3e34 100644
|
|
|
3978af |
--- a/libmultipath/configure.c
|
|
|
3978af |
+++ b/libmultipath/configure.c
|
|
|
3978af |
@@ -1043,7 +1043,8 @@ deadmap (struct multipath * mpp)
|
|
|
3978af |
return 1; /* dead */
|
|
|
3978af |
}
|
|
|
3978af |
|
|
|
3978af |
-int check_daemon(void)
|
|
|
3978af |
+extern int
|
|
|
3978af |
+check_daemon(void)
|
|
|
3978af |
{
|
|
|
3978af |
int fd;
|
|
|
3978af |
char *reply;
|
|
|
3978af |
@@ -1097,6 +1098,8 @@ int coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid,
|
|
|
3978af |
struct config *conf;
|
|
|
3978af |
int allow_queueing;
|
|
|
3978af |
uint64_t *size_mismatch_seen;
|
|
|
3978af |
+ bool map_processed = false;
|
|
|
3978af |
+ bool no_daemon = false;
|
|
|
3978af |
|
|
|
3978af |
/* ignore refwwid if it's empty */
|
|
|
3978af |
if (refwwid && !strlen(refwwid))
|
|
|
3978af |
@@ -1239,7 +1242,9 @@ int coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid,
|
|
|
3978af |
conf = get_multipath_config();
|
|
|
3978af |
allow_queueing = conf->allow_queueing;
|
|
|
3978af |
put_multipath_config(conf);
|
|
|
3978af |
- if (!is_daemon && !allow_queueing && !check_daemon()) {
|
|
|
3978af |
+ if (!is_daemon && !allow_queueing &&
|
|
|
3978af |
+ (no_daemon || !check_daemon())) {
|
|
|
3978af |
+ no_daemon = true;
|
|
|
3978af |
if (mpp->no_path_retry != NO_PATH_RETRY_UNDEF &&
|
|
|
3978af |
mpp->no_path_retry != NO_PATH_RETRY_FAIL)
|
|
|
3978af |
condlog(3, "%s: multipathd not running, unset "
|
|
|
3978af |
@@ -1267,6 +1272,7 @@ int coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid,
|
|
|
3978af |
else
|
|
|
3978af |
remove_map(mpp, vecs, 0);
|
|
|
3978af |
}
|
|
|
3978af |
+ map_processed = true;
|
|
|
3978af |
}
|
|
|
3978af |
/*
|
|
|
3978af |
* Flush maps with only dead paths (ie not in sysfs)
|
|
|
3978af |
@@ -1292,6 +1298,9 @@ int coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid,
|
|
|
3978af |
condlog(2, "%s: remove (dead)", alias);
|
|
|
3978af |
}
|
|
|
3978af |
}
|
|
|
3978af |
+ if (map_processed && !is_daemon && (no_daemon || !check_daemon()))
|
|
|
3978af |
+ condlog(2, "multipath devices exist, but multipathd service is not running");
|
|
|
3978af |
+
|
|
|
3978af |
ret = CP_OK;
|
|
|
3978af |
out:
|
|
|
3978af |
free(size_mismatch_seen);
|
|
|
3978af |
diff --git a/libmultipath/configure.h b/libmultipath/configure.h
|
|
|
3978af |
index 81090dd4..8a266d31 100644
|
|
|
3978af |
--- a/libmultipath/configure.h
|
|
|
3978af |
+++ b/libmultipath/configure.h
|
|
|
3978af |
@@ -59,3 +59,4 @@ struct udev_device *get_udev_device(const char *dev, enum devtypes dev_type);
|
|
|
3978af |
void trigger_paths_udev_change(struct multipath *mpp, bool is_mpath);
|
|
|
3978af |
void trigger_partitions_udev_change(struct udev_device *dev, const char *action,
|
|
|
3978af |
int len);
|
|
|
3978af |
+int check_daemon(void);
|
|
|
3978af |
diff --git a/multipath/main.c b/multipath/main.c
|
|
|
3978af |
index 607cada2..14d045c9 100644
|
|
|
3978af |
--- a/multipath/main.c
|
|
|
3978af |
+++ b/multipath/main.c
|
|
|
3978af |
@@ -254,6 +254,7 @@ get_dm_mpvec (enum mpath_cmds cmd, vector curmp, vector pathvec, char * refwwid)
|
|
|
3978af |
int i;
|
|
|
3978af |
struct multipath * mpp;
|
|
|
3978af |
char params[PARAMS_SIZE], status[PARAMS_SIZE];
|
|
|
3978af |
+ bool maps_present = false;
|
|
|
3978af |
|
|
|
3978af |
if (dm_get_maps(curmp))
|
|
|
3978af |
return 1;
|
|
|
3978af |
@@ -302,6 +303,8 @@ get_dm_mpvec (enum mpath_cmds cmd, vector curmp, vector pathvec, char * refwwid)
|
|
|
3978af |
|
|
|
3978af |
if (cmd == CMD_CREATE)
|
|
|
3978af |
reinstate_paths(mpp);
|
|
|
3978af |
+
|
|
|
3978af |
+ maps_present = true;
|
|
|
3978af |
}
|
|
|
3978af |
|
|
|
3978af |
if (cmd == CMD_LIST_SHORT || cmd == CMD_LIST_LONG) {
|
|
|
3978af |
@@ -311,6 +314,8 @@ get_dm_mpvec (enum mpath_cmds cmd, vector curmp, vector pathvec, char * refwwid)
|
|
|
3978af |
put_multipath_config(conf);
|
|
|
3978af |
}
|
|
|
3978af |
|
|
|
3978af |
+ if (maps_present && !check_daemon())
|
|
|
3978af |
+ condlog(2, "multipath devices exist, but multipathd service is not running");
|
|
|
3978af |
return 0;
|
|
|
3978af |
}
|
|
|
3978af |
|