Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ppc64-diag for openSUSE:Factory checked in at 2023-07-19 19:11:12 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ppc64-diag (Old) and /work/SRC/openSUSE:Factory/.ppc64-diag.new.5570 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ppc64-diag" Wed Jul 19 19:11:12 2023 rev:49 rq:1099474 version:2.7.9 Changes: -------- --- /work/SRC/openSUSE:Factory/ppc64-diag/ppc64-diag.changes 2022-10-18 12:45:34.829803049 +0200 +++ /work/SRC/openSUSE:Factory/.ppc64-diag.new.5570/ppc64-diag.changes 2023-07-19 19:11:19.000805716 +0200 @@ -1,0 +2,6 @@ +Wed Jul 19 10:12:11 UTC 2023 - Michal Suchanek <msucha...@suse.de> + +- Do not delete old system dumps offloaded from HMC (bsc#1209274 ltc#198526). + + 0001-rtas_errd-Handle-multiple-platform-dumps.patch + +------------------------------------------------------------------- New: ---- rtas_errd-Handle-multiple-platform-dumps.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ppc64-diag.spec ++++++ --- /var/tmp/diff_new_pack.CZ6jga/_old 2023-07-19 19:11:19.648809506 +0200 +++ /var/tmp/diff_new_pack.CZ6jga/_new 2023-07-19 19:11:19.652809529 +0200 @@ -1,7 +1,7 @@ # # spec file for package ppc64-diag # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,6 +26,8 @@ Source0: https://github.com/power-ras/ppc64-diag/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz #PATCH-FIX-OPENSUSE - ppc64-diag.varunused.patch - fix unused variables Patch1: ppc64-diag.varunused.patch +#PATCH-FIX-UPSTREAM - 0001-rtas_errd-Handle-multiple-platform-dumps.patch - store multiple dumps +Patch2: rtas_errd-Handle-multiple-platform-dumps.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: bison ++++++ rtas_errd-Handle-multiple-platform-dumps.patch ++++++ >From d05654e5ec6f37cf6caa491fc7d95b336f9603e2 Mon Sep 17 00:00:00 2001 From: Sathvika Vasireddy <s...@linux.ibm.com> Date: Mon, 10 Jul 2023 13:43:21 +0530 Subject: [PATCH] rtas_errd: Handle multiple platform dumps References: bsc#1209274 ltc#198526 Git-commit: d05654e5ec6f37cf6caa491fc7d95b336f9603e2 Currently, whenever a new dump arrives, old dump file of that specific dump type is removed before writing the new dump out. Any dump file with the same prefix (dump type) gets deleted. This means only one set of dump files is saved, since only one dump file per dump type is saved. Handle multiple dumps on Linux by allowing as many dumps to be offloaded until disk space is available. To do this, remove the function that checks for prefix size and removes old dump files. In the event of not enough disk space available, log an error to the user along with the dump tag. User will free up space and run extract_platdump tool using the dump tag provided in the error message to offload the dump. Error log can be viewed by the user by issuing 'journalctl -p err -t rtas_errd' command. Signed-off-by: Sathvika Vasireddy <s...@linux.ibm.com> Signed-off-by: Mahesh Salgaonkar <mah...@linux.ibm.com> --- rtas_errd/dump.c | 29 ++++++++++++++++++++++++++++- rtas_errd/extract_platdump.c | 6 ------ 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/rtas_errd/dump.c b/rtas_errd/dump.c index cc50d91b593b..494c322c4164 100644 --- a/rtas_errd/dump.c +++ b/rtas_errd/dump.c @@ -30,8 +30,10 @@ #include <fcntl.h> #include <librtas.h> #include <librtasevent.h> +#include <syslog.h> #include <sys/stat.h> #include <sys/wait.h> +#include <sys/statvfs.h> #include "utils.h" #include "rtas_errd.h" @@ -284,7 +286,9 @@ void check_platform_dump(struct event *event) { struct rtas_dump_scn *dump_scn; + struct statvfs vfs; uint64_t dump_tag; + uint64_t dump_size; char filename[DUMP_MAX_FNAME_LEN + 20], *pos; char *pathname = NULL; FILE *f; @@ -306,11 +310,34 @@ check_platform_dump(struct event *event) return; } - /* Retrieve the dump */ + /* Retrieve the dump tag */ dump_tag = dump_scn->id; dump_tag |= ((uint64_t)dump_scn->v6hdr.subtype << 32); dbg("Dump ID: 0x%016LX", dump_tag); + if (statvfs(d_cfg.platform_dump_path, &vfs) == -1) { + log_msg(event, "statvfs() failed on %s: %s", + d_cfg.platform_dump_path, strerror(errno)); + return; + } + + /* Retrieve the size of the platform dump */ + dump_size = dump_scn->size_hi; + dump_size <<= 32; + dump_size |= dump_scn->size_lo; + + /* Check if there is sufficient space in the file system to store the dump */ + if (vfs.f_bavail * vfs.f_frsize < dump_size) { + syslog(LOG_ERR, "Insufficient space in %s to store platform dump for dump ID: " + "0x%016lX (required: %lu bytes, available: %lu bytes)", + d_cfg.platform_dump_path, dump_tag, dump_size, + (vfs.f_bavail * vfs.f_frsize)); + syslog(LOG_ERR, "After clearing space, run 'extract_platdump " + "0x%016lX'.\n", dump_tag); + return; + } + + /* Retrieve the dump */ snprintf(tmp_sys_arg, 60, "0x%016LX", (long long unsigned int)dump_tag); system_args[0] = EXTRACT_PLATDUMP_CMD; system_args[1] = tmp_sys_arg; diff --git a/rtas_errd/extract_platdump.c b/rtas_errd/extract_platdump.c index fbe65b2fe5c5..831e57ea8b69 100644 --- a/rtas_errd/extract_platdump.c +++ b/rtas_errd/extract_platdump.c @@ -290,12 +290,6 @@ extract_platform_dump(uint64_t dump_tag) } } - /* - * Before writing the new dump out, we need to see if any older - * dumps need to be removed first - */ - remove_old_dumpfiles(filename, prefix_size); - /* Copy the dump off to the filesystem */ pathname[0] = '\0'; strcpy(pathname, d_cfg.platform_dump_path); -- 2.41.0