1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

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.
This commit is contained in:
David Teigland 2017-08-28 16:24:00 -05:00
parent c8fdc5c087
commit f847fcd31a
3 changed files with 12 additions and 1 deletions

View File

@ -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");
}
}

View File

@ -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;
}

View File

@ -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