summaryrefslogtreecommitdiffstats
path: root/plugins/volcap
diff options
context:
space:
mode:
authorNishanth Thomas <nthomas@redhat.com>2014-06-20 18:44:27 +0530
committerSahina Bose <sabose@redhat.com>2014-06-20 08:28:31 -0700
commit9f49d1b5bf1918e73794d4492ea5b7f2e7ac4e45 (patch)
tree0396539889cc435a076c9617497eef0dd3555613 /plugins/volcap
parent292b1c51bb7a93d0f3218ab3c7c5286bc095a7d9 (diff)
gluster-nagios-addons: Volume utilization returns negative values when size in TB
data overflow error in volcap.c. statvfs returns unsigned long which is boxed into int causing the error Change-Id: I85a1e0d584bf4d9e73b2bfebebea83cd9fbddf68 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1111558 Signed-off-by: Nishanth Thomas <nthomas@redhat.com> Reviewed-on: http://review.gluster.org/8136 Tested-by: Nishanth Thomas <nishusemail@gmail.com> Reviewed-by: Shubhendu Tripathi <shtripat@redhat.com> Reviewed-by: Bala FA <barumuga@redhat.com> Reviewed-by: Sahina Bose <sabose@redhat.com>
Diffstat (limited to 'plugins/volcap')
-rw-r--r--plugins/volcap/volCap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/volcap/volCap.c b/plugins/volcap/volCap.c
index 5eb61db..8c0c4e4 100644
--- a/plugins/volcap/volCap.c
+++ b/plugins/volcap/volCap.c
@@ -115,7 +115,7 @@ static PyObject *glfspy_statvfs (PyObject *self, PyObject *args)
closelog ();
//return Py_BuildValue("i", rv);
if(rv == 0)
- return Py_BuildValue("{s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i}","f_bsize",buf.f_bsize,"f_frsize",buf.f_frsize,"f_blocks",buf.f_blocks,"f_bfree",buf.f_bfree,"f_bavail",buf.f_bavail,"f_files",buf.f_files,"f_ffree",buf.f_ffree,"f_favail",buf.f_favail,"f_fsid",buf.f_fsid,"f_flag",buf.f_flag,"f_namemax",buf.f_namemax);
+ return Py_BuildValue("{s:l,s:l,s:l,s:l,s:l,s:l,s:l,s:l,s:l,s:l,s:l}","f_bsize",buf.f_bsize,"f_frsize",buf.f_frsize,"f_blocks",buf.f_blocks,"f_bfree",buf.f_bfree,"f_bavail",buf.f_bavail,"f_files",buf.f_files,"f_ffree",buf.f_ffree,"f_favail",buf.f_favail,"f_fsid",buf.f_fsid,"f_flag",buf.f_flag,"f_namemax",buf.f_namemax);
else {
if(rv == USAGE_ERROR)
PyErr_SetString(StatvfsError, "Usage error");