6356810
--- util-linux-2.12p/mount/mount_by_label.c.lvm2dupes	2005-04-25 11:33:53.657880224 +0200
6356810
+++ util-linux-2.12p/mount/mount_by_label.c	2005-04-25 11:36:32.075797040 +0200
6356810
@@ -195,6 +195,15 @@
6356810
 	return 1;
6356810
 }
6356810
 
6356810
+/* We need to avoid listing /dev/dm-X devices, because they are added to the uuidcache separately by the
6356810
+   uuidcache_init_dm routine. Duplicate entries cause mount-by-label to fail.
6356810
+ */
6356810
+static int
6356810
+is_lvm2(char *ptname)
6356810
+{
6356810
+	return !strncmp(ptname, "dm-", 3);
6356810
+}
6356810
+
6356810
 static void
6356810
 uuidcache_init(void) {
6356810
 	char line[100];
6356810
@@ -266,7 +275,7 @@
6356810
 		/* devfs has .../disc and .../part1 etc. */
6356810
 
6356810
 		for (s = ptname; *s; s++);
6356810
-		if (isdigit(s[-1]) || is_xvm(ptname)) {
6356810
+		if ((isdigit(s[-1]) || is_xvm(ptname)) && !is_lvm2(ptname)) {
6356810
 			
6356810
 		/*
6356810
 		 * Note: this is a heuristic only - there is no reason