980768
From 34bf5d61e5ea1bd9450db6197fc9791a8e7aa8da Mon Sep 17 00:00:00 2001
980768
From: Marius Vollmer <mvollmer@redhat.com>
980768
Date: Wed, 13 Dec 2017 15:28:23 +0200
980768
Subject: [PATCH] lvm2: Don't match prefixes in cmp_int_lv_name
980768
980768
Once the whole internal name has matched, the other name must also be
980768
at the end.  Otherwise we might find "lvol0" when looking for
980768
"lvol0_meta", for example.
980768
980768
The symptom is that the size of a pool is reported as twice its data
980768
size, instead of data plus metadata size, which funnily is exactly the
980768
same symptom fixed by 043edcb.  Deja vu...
980768
980768
(cherry picked from commit 821bc20911e9a446b943cf40abe0e8a8132bf418)
980768
---
980768
 modules/lvm2/udiskslinuxvolumegroupobject.c | 2 +-
980768
 1 file changed, 1 insertion(+), 1 deletion(-)
980768
980768
diff --git a/modules/lvm2/udiskslinuxvolumegroupobject.c b/modules/lvm2/udiskslinuxvolumegroupobject.c
980768
index 617af04..3f622a6 100644
980768
--- a/modules/lvm2/udiskslinuxvolumegroupobject.c
980768
+++ b/modules/lvm2/udiskslinuxvolumegroupobject.c
980768
@@ -530,7 +530,7 @@ cmp_int_lv_name (const gchar *int_lv_name, const gchar *lv_name)
980768
 
980768
   if (*c == ']')
980768
     c++;
980768
-  if (*c == '\0')
980768
+  if (*c == '\0' && lv_name[c - int_lv_name] == '\0')
980768
     return TRUE;
980768
 
980768
   return FALSE;
980768
-- 
980768
1.8.3.1
980768