1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

lvmlockd: fix starting dlm global lockspace

lvmlockd would fail to recognize that the global lockspace
failed to start if the dlm wasn't running, so future attempts
to start the dlm global lockspace would do nothing, thinking
it was already running.
This commit is contained in:
David Teigland 2015-08-27 16:00:24 -05:00
parent e4d5d05119
commit 3c1924c9c0
3 changed files with 9 additions and 10 deletions

View File

@ -2403,6 +2403,9 @@ out_act:
ls->drop_vg = drop_vg;
pthread_mutex_unlock(&lockspaces_mutex);
if (gl_use_dlm && !strcmp(ls->name, gl_lsname_dlm))
dlm_gl_lockspace_running = 0;
/* worker_thread will join this thread, and free the ls */
pthread_mutex_lock(&worker_mutex);
worker_wake = 1;
@ -2584,21 +2587,21 @@ static int add_dlm_global_lockspace(struct action *act)
{
int rv;
if (gl_running_dlm)
if (dlm_gl_lockspace_running)
return -EEXIST;
gl_running_dlm = 1;
dlm_gl_lockspace_running = 1;
/*
* There's a short period after which a previous gl lockspace thread
* has set gl_running_dlm = 0, but before its ls struct has been
* deleted, during which this add_lockspace_thread() can fail with
* has set dlm_gl_lockspace_running = 0, but before its ls struct has
* been deleted, during which this add_lockspace_thread() can fail with
* -EAGAIN.
*/
rv = add_lockspace_thread(gl_lsname_dlm, NULL, NULL, LD_LM_DLM, NULL, act);
if (rv < 0) {
log_error("add_dlm_global_lockspace add_lockspace_thread %d", rv);
gl_running_dlm = 0;
dlm_gl_lockspace_running = 0;
}
return rv;

View File

@ -260,10 +260,6 @@ int lm_rem_lockspace_dlm(struct lockspace *ls, int free_vg)
out:
free(lmd);
ls->lm_data = NULL;
if (!strcmp(ls->name, gl_lsname_dlm))
gl_running_dlm = 0;
return 0;
}

View File

@ -313,7 +313,7 @@ static inline int list_empty(const struct list_head *head)
* or when disable_gl matches.
*/
EXTERN int gl_running_dlm;
EXTERN int dlm_gl_lockspace_running;
EXTERN int gl_type_static;
EXTERN int gl_use_dlm;
EXTERN int gl_use_sanlock;