Blob Blame History Raw
diff -Naurp pcp-3.11.3.orig/src/pmdas/linux/filesys.c pcp-3.11.3/src/pmdas/linux/filesys.c
--- pcp-3.11.3.orig/src/pmdas/linux/filesys.c	2016-02-29 11:53:04.000000000 +1100
+++ pcp-3.11.3/src/pmdas/linux/filesys.c	2016-07-07 16:46:00.633663707 +1000
@@ -1,7 +1,7 @@
 /*
  * Linux Filesystem Cluster
  *
- * Copyright (c) 2014-2015 Red Hat.
+ * Copyright (c) 2014-2016 Red Hat.
  * Copyright (c) 2000,2004,2007-2008 Silicon Graphics, Inc.  All Rights Reserved.
  * 
  * This program is free software; you can redistribute it and/or modify it
@@ -90,8 +90,12 @@ refresh_filesys(pmInDom filesys_indom, p
 	}
 	else if (strncmp(device, "/dev", 4) != 0)
 	    continue;
-	if (realpath(device, src) != NULL)
-	    device = src;
+
+	/* keep dm and md persistent names, RHBZ#1349932 */
+	if (strncmp(device, "/dev/mapper", 11) != 0 && strncmp(device, "/dev/md", 7) != 0) {
+	    if (realpath(device, src) != NULL)
+		device = src;
+	}
 
 	sts = pmdaCacheLookupName(indom, device, NULL, (void **)&fs);
 	if (sts == PMDA_CACHE_ACTIVE)	/* repeated line in /proc/mounts? */
diff -Naurp pcp-3.11.3.orig/src/pmdas/mounts/mounts.c pcp-3.11.3/src/pmdas/mounts/mounts.c
--- pcp-3.11.3.orig/src/pmdas/mounts/mounts.c	2016-02-29 11:53:04.000000000 +1100
+++ pcp-3.11.3/src/pmdas/mounts/mounts.c	2016-07-07 16:46:00.633663707 +1000
@@ -1,7 +1,7 @@
 /*
  * Mounts PMDA, info on current tracked filesystem mounts
  *
- * Copyright (c) 2012,2015 Red Hat.
+ * Copyright (c) 2012,2015-2016 Red Hat.
  * Copyright (c) 2001,2003,2004 Silicon Graphics, Inc.  All Rights Reserved.
  * Copyright (c) 2001 Alan Bailey (bailey@mcs.anl.gov or abailey@ncsa.uiuc.edu) 
  * All rights reserved. 
@@ -323,7 +323,8 @@ mounts_refresh_mounts(void)
 	    if (strcmp(path, mounts[item].i_name) != 0)
 		continue;
 	    strncpy(mp->type, type, MAXFSTYPE-1);
-	    if (realpath(device, mp->device) == NULL)
+	    /* don't resolve dm symlinks - we want the persistent device name, not the dm-* name */
+	    if (strncmp(device, "/dev/mapper", 11) == 0 || realpath(device, mp->device) == NULL)
 		strncpy(mp->device, device, MAXPATHLEN-1);
 	    strncpy(mp->options, options, MAXOPTSTR-1);
 	    mp->flags = MOUNTS_FLAG_UP;