diff options
author | David Teigland <teigland@redhat.com> | 2017-08-28 16:24:00 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2017-08-28 16:24:00 -0500 |
commit | f847fcd31a41f61dd81b30ac91f3e2720088b8f2 (patch) | |
tree | 97e1369cfb2bd2947689d92ef183fb38f261d55a | |
parent | c8fdc5c0877b137ed3ca1f217d8ef0fa89299a9a (diff) | |
download | lvm2-f847fcd31a41f61dd81b30ac91f3e2720088b8f2.tar.gz |
lvmlockd: print error about starting lock manager
In the case where lvmlockd is running, but no lock manager
is running, we should print a specific error message about
that situation.
-rw-r--r-- | daemons/lvmlockd/lvmlockd-core.c | 2 | ||||
-rw-r--r-- | lib/locking/lvmlockd.c | 10 | ||||
-rw-r--r-- | lib/locking/lvmlockd.h | 1 |
3 files changed, 12 insertions, 1 deletions
diff --git a/daemons/lvmlockd/lvmlockd-core.c b/daemons/lvmlockd/lvmlockd-core.c index 903da7c20..f9d07c151 100644 --- a/daemons/lvmlockd/lvmlockd-core.c +++ b/daemons/lvmlockd/lvmlockd-core.c @@ -3676,7 +3676,7 @@ static int client_send_result(struct client *cl, struct action *act) if (!gl_lsname_dlm[0]) strcat(result_flags, "NO_GL_LS,"); } else { - strcat(result_flags, "NO_GL_LS,"); + strcat(result_flags, "NO_GL_LS,NO_LM"); } } diff --git a/lib/locking/lvmlockd.c b/lib/locking/lvmlockd.c index d85021cc6..a0e3f0352 100644 --- a/lib/locking/lvmlockd.c +++ b/lib/locking/lvmlockd.c @@ -115,6 +115,9 @@ static void _flags_str_to_lockd_flags(const char *flags_str, uint32_t *lockd_fla if (strstr(flags_str, "NO_GL_LS")) *lockd_flags |= LD_RF_NO_GL_LS; + if (strstr(flags_str, "NO_LM")) + *lockd_flags |= LD_RF_NO_LM; + if (strstr(flags_str, "DUP_GL_LS")) *lockd_flags |= LD_RF_DUP_GL_LS; @@ -1362,6 +1365,9 @@ int lockd_gl_create(struct cmd_context *cmd, const char *def_mode, const char *v log_error("Global lock failed: check that VG holding global lock exists and is started."); else log_error("Global lock failed: check that global lockspace is started."); + + if (lockd_flags & LD_RF_NO_LM) + log_error("Start a lock manager, lvmlockd did not find one running."); return 0; } @@ -1565,6 +1571,9 @@ int lockd_gl(struct cmd_context *cmd, const char *def_mode, uint32_t flags) * access to lease storage. */ + if (result == -ENOLS && (lockd_flags & LD_RF_NO_LM)) + log_error("Start a lock manager, lvmlockd did not find one running."); + if (result == -ENOLS || result == -ESTARTING || result == -EVGKILLED || @@ -1583,6 +1592,7 @@ int lockd_gl(struct cmd_context *cmd, const char *def_mode, uint32_t flags) log_error("Global lock failed: storage failed for sanlock leases"); else log_error("Global lock failed: error %d", result); + return 0; } diff --git a/lib/locking/lvmlockd.h b/lib/locking/lvmlockd.h index 8b282d8c6..cf23e9b8b 100644 --- a/lib/locking/lvmlockd.h +++ b/lib/locking/lvmlockd.h @@ -28,6 +28,7 @@ #define LD_RF_NO_GL_LS 0x00000002 #define LD_RF_WARN_GL_REMOVED 0x00000004 #define LD_RF_DUP_GL_LS 0x00000008 +#define LD_RF_NO_LM 0x00000010 /* lockd_state flags */ #define LDST_EX 0x00000001 |