]> sourceware.org Git - lvm2.git/commitdiff
activation: trimming string is expected
authorZdenek Kabelac <zkabelac@redhat.com>
Thu, 8 Nov 2018 09:02:28 +0000 (10:02 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Thu, 8 Nov 2018 11:20:57 +0000 (12:20 +0100)
Commit 813347cf84617a946d9184f44c5fbd275bb41766 added extra validation,
however in this particular we do want to trim suffix out so rather ignore
resulting error code here intentionaly.

lib/activate/dev_manager.c

index 49f425bbd078779e9527bfa4fa5914df36ffb9a0..f0c5254524ee4bddd9c503f3e24a4c3d0b64804d 100644 (file)
@@ -2061,11 +2061,8 @@ static int _check_holder(struct dev_manager *dm, struct dm_tree *dtree,
 
                if (!strncmp(uuid, (char*)&lv->vg->id, sizeof(lv->vg->id)) &&
                    !dm_tree_find_node_by_uuid(dtree, uuid)) {
-                       if (!dm_strncpy((char*)&id, uuid, 2 * sizeof(struct id) + 1)) {
-                               log_error(INTERNAL_ERROR "Too long UUID %s in VG %s.",
-                                         uuid, lv->vg->name);
-                               goto out;
-                       }
+                       /* trims any UUID suffix (i.e. -cow) */
+                       (void) dm_strncpy((char*)&id, uuid, 2 * sizeof(struct id) + 1);
 
                        /* If UUID is not yet in dtree, look for matching LV */
                        if (!(lv_det = find_lv_in_vg_by_lvid(lv->vg, &id))) {
This page took 0.043037 seconds and 5 git commands to generate.