summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8bf6aee)
raw | patch | inline | side by side (parent: 8bf6aee)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 27 Aug 2009 21:51:23 +0000 (23:51 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Thu, 27 Aug 2009 21:51:23 +0000 (23:51 +0200) |
This is an upstream patch to fix the handling of the ignorelist in the df
plugin.
Thanks to Joey Hess for reporting this.
Closes: #542859
plugin.
Thanks to Joey Hess for reporting this.
Closes: #542859
debian/changelog | patch | blob | history | |
debian/patches/00list | patch | blob | history | |
debian/patches/bts542859-df-fix-ignorelist.dpatch | [new file with mode: 0755] | patch | blob |
diff --git a/debian/changelog b/debian/changelog
index e6d693689a0c40da0d44621c9104a51d12d46283..9fae6c3a50801b61f84b6919f0dce9c71b9f3550 100644 (file)
--- a/debian/changelog
+++ b/debian/changelog
the handling of the LocalSocket config option of the powerdns plugin;
thanks to Thomas Morgan for reporting this and Luke Heberling for
providing a patch (references: #535787).
+ - Added bts542859-df-fix-ignorelist.dpatch - upstream patch to fix the
+ handling of the ignorelist in the df plugin; thanks to Joey Hess for
+ reporting this (Closes: #542859).
* debian/README.Debian:
- Removed the note about how to get collectd2html.pl working with
version 4 of collectd - the script now supports the --recursive option
- Set the 'apache' plugin's URL according to the default used by Debian's
Apache; thanks to Joey Hess for reporting this (Closes: #541888).
- -- Sebastian Harl <tokkee@debian.org> Thu, 27 Aug 2009 23:41:50 +0200
+ -- Sebastian Harl <tokkee@debian.org> Thu, 27 Aug 2009 23:49:54 +0200
collectd (4.6.3-1) unstable; urgency=low
diff --git a/debian/patches/00list b/debian/patches/00list
index 06e05c44fd1cb213ff78287bf0d3babd36ea0d1f..2bf5010857541373f545fc41cc2e22cfa6abd358 100644 (file)
--- a/debian/patches/00list
+++ b/debian/patches/00list
java-fix-jvm-start.dpatch
curl-followlocation.dpatch
bts535787-powerdns-fix-localsocket.dpatch
+bts542859-df-fix-ignorelist.dpatch
diff --git a/debian/patches/bts542859-df-fix-ignorelist.dpatch b/debian/patches/bts542859-df-fix-ignorelist.dpatch
--- /dev/null
@@ -0,0 +1,56 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## bts542859-df-fix-ignorelist.dpatch by Florian Forster <octo@verplant.org>
+##
+## DP: df plugin: Check ignorelists before stat'ing the filesystem.
+
+@DPATCH@
+
+diff a/src/df.c b/src/df.c
+--- a/src/df.c
++++ b/src/df.c
+@@ -155,22 +155,6 @@ static int df_read (void)
+
+ for (mnt_ptr = mnt_list; mnt_ptr != NULL; mnt_ptr = mnt_ptr->next)
+ {
+- if (STATANYFS (mnt_ptr->dir, &statbuf) < 0)
+- {
+- char errbuf[1024];
+- ERROR ("statv?fs failed: %s",
+- sstrerror (errno, errbuf,
+- sizeof (errbuf)));
+- continue;
+- }
+-
+- if (!statbuf.f_blocks)
+- continue;
+-
+- blocksize = BLOCKSIZE(statbuf);
+- df_free = statbuf.f_bfree * blocksize;
+- df_used = (statbuf.f_blocks - statbuf.f_bfree) * blocksize;
+-
+ if (strcmp (mnt_ptr->dir, "/") == 0)
+ {
+ sstrncpy (mnt_name, "root", sizeof (mnt_name));
+@@ -197,6 +181,22 @@ static int df_read (void)
+ if (ignorelist_match (il_fstype, mnt_ptr->type))
+ continue;
+
++ if (STATANYFS (mnt_ptr->dir, &statbuf) < 0)
++ {
++ char errbuf[1024];
++ ERROR ("statv?fs failed: %s",
++ sstrerror (errno, errbuf,
++ sizeof (errbuf)));
++ continue;
++ }
++
++ if (!statbuf.f_blocks)
++ continue;
++
++ blocksize = BLOCKSIZE(statbuf);
++ df_free = statbuf.f_bfree * blocksize;
++ df_used = (statbuf.f_blocks - statbuf.f_bfree) * blocksize;
++
+ df_submit (mnt_name, df_used, df_free);
+ }
+