mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Fix empty string warning logic in _find_config_str. (1.02.68)
pvcreate gives WARNING: Ignoring unsupported value for metadata/pvmetadataignore. It was warning if there is no config file entry instead of only if the node exists but is empty.
This commit is contained in:
parent
c682e83760
commit
ebf5552754
@ -1,5 +1,6 @@
|
|||||||
Version 1.02.73 -
|
Version 1.02.73 -
|
||||||
====================================
|
====================================
|
||||||
|
Fix empty string warning logic in _find_config_str. (1.02.68)
|
||||||
Fix dm_task_set_name to properly resolve path to dm name (1.02.71).
|
Fix dm_task_set_name to properly resolve path to dm name (1.02.71).
|
||||||
Add dm_strncpy() function as a faster strncpy() replacement.
|
Add dm_strncpy() function as a faster strncpy() replacement.
|
||||||
|
|
||||||
|
@ -751,14 +751,16 @@ static const char *_find_config_str(const void *start, node_lookup_fn find_fn,
|
|||||||
{
|
{
|
||||||
const struct dm_config_node *n = find_fn(start, path);
|
const struct dm_config_node *n = find_fn(start, path);
|
||||||
|
|
||||||
/* Empty strings are ignored */
|
/* Empty strings are ignored if allow_empty is set */
|
||||||
if ((n && n->v && n->v->type == DM_CFG_STRING) &&
|
if (n && n->v) {
|
||||||
|
if ((n->v->type == DM_CFG_STRING) &&
|
||||||
(allow_empty || (*n->v->v.str))) {
|
(allow_empty || (*n->v->v.str))) {
|
||||||
log_very_verbose("Setting %s to %s", path, n->v->v.str);
|
log_very_verbose("Setting %s to %s", path, n->v->v.str);
|
||||||
return n->v->v.str;
|
return n->v->v.str;
|
||||||
} else if (n && (!n->v || (n->v->type != DM_CFG_STRING) ||
|
}
|
||||||
(!allow_empty && fail)))
|
if ((n->v->type != DM_CFG_STRING) || (!allow_empty && fail))
|
||||||
log_warn("WARNING: Ignoring unsupported value for %s.", path);
|
log_warn("WARNING: Ignoring unsupported value for %s.", path);
|
||||||
|
}
|
||||||
|
|
||||||
if (fail)
|
if (fail)
|
||||||
log_very_verbose("%s not found in config: defaulting to %s",
|
log_very_verbose("%s not found in config: defaulting to %s",
|
||||||
|
Loading…
Reference in New Issue
Block a user