The Samba-Bugzilla – Attachment 12541 Details for
Bug 12362
Fix division by zero error in 05.system event script
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patches for v4-4 branch
BZ12362-v4-4.patch (text/plain), 2.32 KB, created by
Amitay Isaacs
on 2016-10-04 15:06:55 UTC
(
hide
)
Description:
Patches for v4-4 branch
Filename:
MIME Type:
Creator:
Amitay Isaacs
Created:
2016-10-04 15:06:55 UTC
Size:
2.32 KB
patch
obsolete
>From 42f9dd823064741282b4f7f2575349014835902d Mon Sep 17 00:00:00 2001 >From: "Jose A. Rivera" <jarrpa@samba.org> >Date: Thu, 21 Apr 2016 13:09:21 -0500 >Subject: [PATCH 1/2] ctdb-scripts: Avoid dividing by zero in memory > calculation > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=12362 > >Don't do a percentage calculation for either memtotal or swaptotal if they >are zero. > >Signed-off-by: Jose A. Rivera <jarrpa@samba.org> >Reviewed-by: Martin Schwenke <martin@meltin.net> >(cherry picked from commit bf3f22315a281fb44a5cd9b075b7915138145d6e) >--- > ctdb/config/events.d/05.system | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/ctdb/config/events.d/05.system b/ctdb/config/events.d/05.system >index 69fcec2..bfa8e7b 100755 >--- a/ctdb/config/events.d/05.system >+++ b/ctdb/config/events.d/05.system >@@ -144,8 +144,8 @@ $1 == "SwapFree:" { swapfree = $2 } > $1 == "SwapTotal:" { swaptotal = $2 } > END { > if (memavail != 0) { memfree = memavail ; } >- print int((memtotal - memfree) / memtotal * 100), >- int((swaptotal - swapfree) / swaptotal * 100) >+ if (memtotal != 0) { print int((memtotal - memfree) / memtotal * 100) ; } else { print 0 ; } >+ if (swaptotal != 0) { print int((swaptotal - swapfree) / swaptotal * 100) ; } else { print 0 ; } > }') > _mem_usage="$1" > _swap_usage="$2" >-- >2.7.4 > > >From d77d61cfddc01338605b98948b1b923494336b1d Mon Sep 17 00:00:00 2001 >From: Martin Schwenke <martin@meltin.net> >Date: Wed, 29 Jun 2016 17:47:12 +1000 >Subject: [PATCH 2/2] ctdb-scripts: Fix incorrect variable reference > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=12362 > >Signed-off-by: Martin Schwenke <martin@meltin.net> >Reviewed-by: Amitay Isaacs <amitay@gmail.com> >(cherry picked from commit eabeecb45322747d7daeb2a79ac213f17eb049da) >--- > ctdb/config/events.d/05.system | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/ctdb/config/events.d/05.system b/ctdb/config/events.d/05.system >index bfa8e7b..603f941 100755 >--- a/ctdb/config/events.d/05.system >+++ b/ctdb/config/events.d/05.system >@@ -47,7 +47,7 @@ check_thresholds () > fi > fi > >- if validate_percentage "$_warn_threshold" "$_what" ; then >+ if validate_percentage "$_warn_threshold" "$_thing" ; then > if [ "$_usage" -ge "$_warn_threshold" ] ; then > if [ -r "$_cache" ] ; then > read _prev <"$_cache" >-- >2.7.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
martins
:
review+
Actions:
View
Attachments on
bug 12362
: 12541