]> sourceware.org Git - lvm2.git/commitdiff
cope with null uuid_prefix
authorAlasdair Kergon <agk@redhat.com>
Tue, 18 Oct 2005 13:57:11 +0000 (13:57 +0000)
committerAlasdair Kergon <agk@redhat.com>
Tue, 18 Oct 2005 13:57:11 +0000 (13:57 +0000)
libdm/libdevmapper.h
libdm/libdm-deptree.c

index e9b517346ad3c6719368766b1a1ef66c719215e3..cc5df7602979bbccea7a671f7cc740bfd124a420 100644 (file)
@@ -247,7 +247,8 @@ const struct dm_info *dm_deptree_node_get_info(struct deptree_node *node);
 int dm_deptree_node_num_children(struct deptree_node *node, uint32_t inverted);
 
 /*
- * Deactivate a device with its dependencies if the uuid prefix matches
+ * Deactivate a device plus all dependencies.
+ * Ignores devices that don't have a uuid starting with uuid_prefix.
  */
 int dm_deptree_deactivate_children(struct deptree_node *dnode,
                                   const char *uuid_prefix,
index b2a2f78488113978e9cdb0715785ed56fe8000a2..f5acf19d3b30db14dae7ba29c4d84f313923a2fd 100644 (file)
@@ -400,7 +400,7 @@ struct deptree_node *dm_deptree_next_child(void **handle,
 }
 
 /*
- * Deactivate a device with its dependencies if the uuid prefix matches
+ * Deactivate a device with its dependencies if the uuid prefix matches.
  */
 static int _info_by_dev(uint32_t major, uint32_t minor, struct dm_info *info)
 {
@@ -454,7 +454,9 @@ static int _deactivate_node(const char *name, uint32_t major, uint32_t minor)
        return r;
 }
 
-int dm_deptree_deactivate_children(struct deptree_node *dnode, const char *uuid_prefix, size_t uuid_prefix_len)
+int dm_deptree_deactivate_children(struct deptree_node *dnode,
+                                  const char *uuid_prefix,
+                                  size_t uuid_prefix_len)
 {
        void *handle = NULL;
        struct deptree_node *child = dnode;
@@ -480,7 +482,7 @@ int dm_deptree_deactivate_children(struct deptree_node *dnode, const char *uuid_
                }
 
                /* Ignore if it doesn't belong to this VG */
-               if (strncmp(uuid, uuid_prefix, uuid_prefix_len))
+               if (uuid_prefix && strncmp(uuid, uuid_prefix, uuid_prefix_len))
                        continue;
 
                /* Refresh open_count */
This page took 0.190832 seconds and 5 git commands to generate.