File ganglia-0008-support-fs-size-for-ZFS-on-Linux.patch of Package ganglia
From: Ben Kurtz <bkurtz@ucsd.edu>
Date: Thu, 10 Mar 2016 22:38:27 -0800
Git-commit: 1c85925e5b1ae99f08c44ea2b3b9567c21f3de9f
References: bsc#1087487
Subject: [PATCH] support fs size for ZFS on Linux
ZFS mounts don't start with '/dev/', so look out for that when skipping mount entries
Acked-by: John Jolly <jjolly@suse.de>
---
libmetrics/linux/metrics.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libmetrics/linux/metrics.c b/libmetrics/linux/metrics.c
index 62e7314b..dec85483 100644
--- a/libmetrics/linux/metrics.c
+++ b/libmetrics/linux/metrics.c
@@ -1388,7 +1388,8 @@ float find_disk_space(double *total_size, double *total_free)
if (!strncmp(mode, "ro", 2)) continue;
if (remote_mount(device, type)) continue;
if (strncmp(device, "/dev/", 5) != 0 &&
- strncmp(device, "/dev2/", 6) != 0) continue;
+ strncmp(device, "/dev2/", 6) != 0 &&
+ strncmp(type, "zfs", 3) != 0) continue;
thispct = device_space(mount, device, total_size, total_free);
debug_msg("Counting device %s (%.2f %%)", device, thispct);
if (!max || max<thispct)
--
2.13.6