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

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