]> sourceware.org Git - lvm2.git/commitdiff
Fix empty string warning logic in _find_config_str. (1.02.68)
authorAlasdair Kergon <agk@redhat.com>
Tue, 28 Feb 2012 17:46:47 +0000 (17:46 +0000)
committerAlasdair Kergon <agk@redhat.com>
Tue, 28 Feb 2012 17:46:47 +0000 (17:46 +0000)
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.

WHATS_NEW_DM
libdm/libdm-config.c

index 7de4785e27d01222511459e09d8b1b3b43585288..49cc80e0f1d6361d74c6bd35dc976f3588641379 100644 (file)
@@ -1,5 +1,6 @@
 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).
   Add dm_strncpy() function as a faster strncpy() replacement.
 
index 97559171b588366a6799d858494028a22f6b95d5..cd71f4e429640ffe5f01ca8cdc44d621d304201c 100644 (file)
@@ -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);
 
-       /* Empty strings are ignored */
-       if ((n && n->v && n->v->type == DM_CFG_STRING) &&
-           (allow_empty || (*n->v->v.str))) {
-               log_very_verbose("Setting %s to %s", path, n->v->v.str);
-               return n->v->v.str;
-       } else if (n && (!n->v || (n->v->type != DM_CFG_STRING) ||
-                        (!allow_empty && fail)))
-               log_warn("WARNING: Ignoring unsupported value for %s.", path);
+       /* Empty strings are ignored if allow_empty is set */
+       if (n && n->v) {
+               if ((n->v->type == DM_CFG_STRING) &&
+                   (allow_empty || (*n->v->v.str))) {
+                       log_very_verbose("Setting %s to %s", path, n->v->v.str);
+                       return n->v->v.str;
+               }
+               if ((n->v->type != DM_CFG_STRING) || (!allow_empty && fail))
+                       log_warn("WARNING: Ignoring unsupported value for %s.", path);
+       }
 
        if (fail)
                log_very_verbose("%s not found in config: defaulting to %s",
This page took 0.037055 seconds and 5 git commands to generate.