All of lore.kernel.org
 help / color / mirror / Atom feed
* master - activation: trimming string is expected
@ 2018-11-08 11:23 Zdenek Kabelac
  0 siblings, 0 replies; only message in thread
From: Zdenek Kabelac @ 2018-11-08 11:23 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c1703845c3d82e381c545b8ad8bde68bafc2fbcf
Commit:        c1703845c3d82e381c545b8ad8bde68bafc2fbcf
Parent:        1dc5603f73940bc59d09afa67c2e8c4da0ce8526
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Thu Nov 8 10:02:28 2018 +0100
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Thu Nov 8 12:20:57 2018 +0100

activation: trimming string is expected

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 |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 49f425b..f0c5254 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -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))) {



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-11-08 11:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-08 11:23 master - activation: trimming string is expected Zdenek Kabelac

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.