diff options
author | David Teigland <teigland@redhat.com> | 2017-08-23 11:25:18 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2017-08-23 11:25:18 -0500 |
commit | 46ddd5520cd4d5415ee936b6cbdb6e1936bc7d26 (patch) | |
tree | 0b07d32e117650fcc0ac7ba9ec3c018a3df46ed5 | |
parent | 539a48a328a7ddd1030dd5809a2f9f0df6c1fe70 (diff) | |
download | lvm2-46ddd5520cd4d5415ee936b6cbdb6e1936bc7d26.tar.gz |
lvmlockd: add comment about temp ls name
-rw-r--r-- | daemons/lvmlockd/lvmlockd-core.c | 10 |
1 files 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:<name> + * 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); |