From 46ddd5520cd4d5415ee936b6cbdb6e1936bc7d26 Mon Sep 17 00:00:00 2001 From: David Teigland Date: Wed, 23 Aug 2017 11:25:18 -0500 Subject: [PATCH] lvmlockd: add comment about temp ls name --- daemons/lvmlockd/lvmlockd-core.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/daemons/lvmlockd/lvmlockd-core.c b/daemons/lvmlockd/lvmlockd-core.c index 6fd4b88de..da17b71cd 100644 --- a/daemons/lvmlockd/lvmlockd-core.c +++ b/daemons/lvmlockd/lvmlockd-core.c @@ -2652,8 +2652,14 @@ out_act: ls->drop_vg = drop_vg; if (ls->lm_type == LD_LM_DLM && !strcmp(ls->name, gl_lsname_dlm)) global_dlm_lockspace_exists = 0; - /* Avoid a name collision of the same lockspace is added again before this thread is cleaned up. */ - /* FIXME: detect loss of 4 chars? (use 'size(tmp_name) == (MAX_NAME - 4)' and fail??) */ + + /* + * Avoid a name collision of the same lockspace is added again before + * this thread is cleaned up. We just set ls->name to a "junk" value + * for the short period until the struct is freed. We could make it + * blank or fill it with garbage, but instead set it to REM: + * to make it easier to follow progress of freeing is via log_debug. + */ dm_strncpy(tmp_name, ls->name, sizeof(tmp_name)); snprintf(ls->name, sizeof(ls->name), "REM:%s", tmp_name); pthread_mutex_unlock(&lockspaces_mutex);