1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

activation: trimming string is expected

Commit 813347cf84 added extra validation,
however in this particular we do want to trim suffix out so rather ignore
resulting error code here intentionaly.
This commit is contained in:
Zdenek Kabelac 2018-11-08 10:02:28 +01:00 committed by David Teigland
parent 35b06d808a
commit 205b4f0146

View File

@ -1916,11 +1916,8 @@ static int _check_holder(struct dev_manager *dm, struct dm_tree *dtree,
if (!strncmp(uuid, (char*)&lv->vg->id, sizeof(lv->vg->id)) && if (!strncmp(uuid, (char*)&lv->vg->id, sizeof(lv->vg->id)) &&
!dm_tree_find_node_by_uuid(dtree, uuid)) { !dm_tree_find_node_by_uuid(dtree, uuid)) {
if (!dm_strncpy((char*)&id, uuid, 2 * sizeof(struct id) + 1)) { /* trims any UUID suffix (i.e. -cow) */
log_error(INTERNAL_ERROR "Too long UUID %s in VG %s.", (void) dm_strncpy((char*)&id, uuid, 2 * sizeof(struct id) + 1);
uuid, lv->vg->name);
goto out;
}
/* If UUID is not yet in dtree, look for matching LV */ /* If UUID is not yet in dtree, look for matching LV */
if (!(lv_det = find_lv_in_vg_by_lvid(lv->vg, &id))) { if (!(lv_det = find_lv_in_vg_by_lvid(lv->vg, &id))) {