From 49ed254f3f18bb188cd09e76bbcd834ad48c67ff Mon Sep 17 00:00:00 2001 From: Mark Reynolds Date: Jul 10 2013 16:21:21 +0000 Subject: Ticket 47385 - Disk Monitoring is not triggered as expected. Bug Description: Is using large values for the threshold the faeture does not work. Fix Description: There was an overflow of a integer value uses to determine if the server should enter the "shutdown mode". Also removed some unnecessary checks to see if disk space is continuing to drop. https://fedorahosted.org/389/ticket/47385 Reviewed by: Noriko(Thanks!) (cherry picked from commit 8486837842cd6779918520a17ca7c48441fe493b) --- diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c index d6ed7fa..4fbfd9d 100644 --- a/ldap/servers/slapd/daemon.c +++ b/ldap/servers/slapd/daemon.c @@ -710,6 +710,7 @@ disk_monitoring_thread(void *nothing) PRInt64 previous_mark = 0; PRInt64 disk_space = 0; PRInt64 threshold = 0; + PRInt64 halfway = 0; time_t start = 0; time_t now = 0; int deleted_rotated_logs = 0; @@ -721,7 +722,6 @@ disk_monitoring_thread(void *nothing) int logs_disabled = 0; int grace_period = 0; int first_pass = 1; - int halfway = 0; int ok_now = 0; while(!g_get_shutdown()) { @@ -814,13 +814,11 @@ disk_monitoring_thread(void *nothing) * access/audit logs, log another error, and continue. */ if(!logs_disabled && !logging_critical){ - if(disk_space < previous_mark){ LDAPDebug(LDAP_DEBUG_ANY, "Disk space is too low on disk (%s), remaining space: %d Kb, " "disabling access and audit logging.\n", dirstr, (disk_space / 1024), 0); config_set_accesslog_enabled(LOGGING_OFF); config_set_auditlog_enabled(LOGGING_OFF); logs_disabled = 1; - } continue; } /* @@ -828,12 +826,10 @@ disk_monitoring_thread(void *nothing) * access/audit logging, then delete the rotated logs, log another error, and continue. */ if(!deleted_rotated_logs && !logging_critical){ - if(disk_space < previous_mark){ LDAPDebug(LDAP_DEBUG_ANY, "Disk space is too low on disk (%s), remaining space: %d Kb, " "deleting rotated logs.\n", dirstr, (disk_space / 1024), 0); log__delete_rotated_logs(); deleted_rotated_logs = 1; - } continue; } /*