From 4f9e8ee289be1061b0fa3cf558b3057522f31bdb Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 17 Jul 2011 11:46:45 +0200 Subject: [PATCH] abrt-server/ccpp_hook: enlarge spool dir pruning threshold. Closes bz#692474 Signed-off-by: Denys Vlasenko (cherry picked from commit c20d967744f1dbbc7d747d8f5d50886f3aefe2bd) diff --git a/src/daemon/abrt-server.c b/src/daemon/abrt-server.c index 20caaae..8153ad6 100644 --- a/src/daemon/abrt-server.c +++ b/src/daemon/abrt-server.c @@ -143,14 +143,15 @@ static int create_debug_dump() /* Trim old crash dumps if necessary */ load_abrt_conf(); free_abrt_conf_data(); /* can do this because we need only g_settings_nMaxCrashReportsSize */ - /* x1.25: go a bit up, so that usual in-daemon trimming - * kicks in first, and we don't "fight" with it: - */ - g_settings_nMaxCrashReportsSize += g_settings_nMaxCrashReportsSize / 4; if (g_settings_nMaxCrashReportsSize > 0) { - check_free_space(g_settings_nMaxCrashReportsSize); - trim_debug_dumps(DEBUG_DUMPS_DIR, g_settings_nMaxCrashReportsSize * (double)(1024*1024), path); + /* x1.25 and round up to 64m: go a bit up, so that usual in-daemon trimming + * kicks in first, and we don't "fight" with it: + */ + unsigned maxsize = g_settings_nMaxCrashReportsSize + g_settings_nMaxCrashReportsSize / 4; + maxsize |= 63; + check_free_space(maxsize); + trim_debug_dumps(DEBUG_DUMPS_DIR, maxsize * (double)(1024*1024), path); } free(path); diff --git a/src/hooks/abrt-hook-ccpp.c b/src/hooks/abrt-hook-ccpp.c index f9a72a6..da3b337 100644 --- a/src/hooks/abrt-hook-ccpp.c +++ b/src/hooks/abrt-hook-ccpp.c @@ -406,10 +406,6 @@ int main(int argc, char** argv) /* Parse abrt.conf */ load_abrt_conf(); free_abrt_conf_data(); /* can do this because we need only g_settings_nMaxCrashReportsSize */ - /* x1.25: go a bit up, so that usual in-daemon trimming - * kicks in first, and we don't "fight" with it: - */ - g_settings_nMaxCrashReportsSize += g_settings_nMaxCrashReportsSize / 4; /* ... and plugins/CCpp.conf */ bool setting_MakeCompatCore; bool setting_SaveBinaryImage; @@ -474,8 +470,12 @@ int main(int argc, char** argv) if (g_settings_nMaxCrashReportsSize > 0) { - g_settings_nMaxCrashReportsSize += g_settings_nMaxCrashReportsSize / 4; - check_free_space(g_settings_nMaxCrashReportsSize); + /* x1.25 and round up to 64m: go a bit up, so that usual in-daemon trimming + * kicks in first, and we don't "fight" with it: + */ + unsigned maxsize = g_settings_nMaxCrashReportsSize + g_settings_nMaxCrashReportsSize / 4; + maxsize |= 63; + check_free_space(maxsize); } char path[PATH_MAX]; @@ -662,7 +662,12 @@ int main(int argc, char** argv) /* rhbz#539551: "abrt going crazy when crashing process is respawned" */ if (g_settings_nMaxCrashReportsSize > 0) { - trim_debug_dumps(DEBUG_DUMPS_DIR, g_settings_nMaxCrashReportsSize * (double)(1024*1024), path); + /* x1.25 and round up to 64m: go a bit up, so that usual in-daemon trimming + * kicks in first, and we don't "fight" with it: + */ + unsigned maxsize = g_settings_nMaxCrashReportsSize + g_settings_nMaxCrashReportsSize / 4; + maxsize |= 63; + trim_debug_dumps(DEBUG_DUMPS_DIR, maxsize * (double)(1024*1024), path); } return 0; -- 1.7.6