From: Sebastian Harl Date: Thu, 27 Aug 2009 21:51:23 +0000 (+0200) Subject: patches: Added bts542859-df-fix-ignorelist.dpatch. X-Git-Tag: collectd-4.7.2-1~9 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3d8d8e3b9d76dc226527e18e000daa3aeeab1a36;p=pkg-collectd.git patches: Added bts542859-df-fix-ignorelist.dpatch. 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 --- diff --git a/debian/changelog b/debian/changelog index e6d6936..9fae6c3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -50,6 +50,9 @@ collectd (4.7.2-1) unstable; urgency=low 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 @@ -67,7 +70,7 @@ collectd (4.7.2-1) unstable; urgency=low - 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 Thu, 27 Aug 2009 23:41:50 +0200 + -- Sebastian Harl 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 06e05c4..2bf5010 100644 --- a/debian/patches/00list +++ b/debian/patches/00list @@ -6,4 +6,5 @@ plugin-fix-unregister.dpatch 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 new file mode 100755 index 0000000..8a55f8c --- /dev/null +++ b/debian/patches/bts542859-df-fix-ignorelist.dpatch @@ -0,0 +1,56 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## bts542859-df-fix-ignorelist.dpatch by Florian Forster +## +## 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); + } +