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

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