Blame SOURCES/0272-dirsize-Skip-dirs-in-which-sosreport-is-being-genera.patch

4b6aa8
From eef59d2358cf63338f38727c5d08be70619e4e55 Mon Sep 17 00:00:00 2001
4b6aa8
From: Martin Kutlak <mkutlak@redhat.com>
4b6aa8
Date: Wed, 14 Aug 2019 16:46:08 +0200
4b6aa8
Subject: [PATCH] dirsize: Skip dirs in which sosreport is being generated
4b6aa8
4b6aa8
With these changes ABRT will skip directories in which sosreport is running
4b6aa8
and won't delete them when MaxCrashReportSize limit is exceeded.
4b6aa8
4b6aa8
I had a concern about the size of the logs that sosreport collects but
4b6aa8
there is a limit set by sosreport for how big the individual logs can
4b6aa8
be and the default value is 25MiB.
4b6aa8
4b6aa8
Fixes: rhbz#1671232
4b6aa8
4b6aa8
Signed-off-by: Martin Kutlak <mkutlak@redhat.com>
4b6aa8
---
4b6aa8
 src/lib/dirsize.c | 5 +++++
4b6aa8
 1 file changed, 5 insertions(+)
4b6aa8
4b6aa8
diff --git a/src/lib/dirsize.c b/src/lib/dirsize.c
4b6aa8
index 6d96e71..7ee9752 100644
4b6aa8
--- a/src/lib/dirsize.c
4b6aa8
+++ b/src/lib/dirsize.c
4b6aa8
@@ -91,6 +91,11 @@ double get_dirsize_find_largest_dir(
4b6aa8
         if (dot_or_dotdot(ep->d_name))
4b6aa8
             continue;
4b6aa8
         char *dname = concat_path_file(pPath, ep->d_name);
4b6aa8
+        if (lstat(concat_path_file(dname, "sosreport.log"), &statbuf) == 0)
4b6aa8
+        {
4b6aa8
+            log_debug("Skipping %s': sosreport is being generated.", dname);
4b6aa8
+            goto next;
4b6aa8
+        }
4b6aa8
         if (lstat(dname, &statbuf) != 0)
4b6aa8
         {
4b6aa8
             goto next;
4b6aa8
-- 
4b6aa8
2.21.0
4b6aa8