diff --git a/bugfix-fix-disk-error-log-storm-2.patch b/bugfix-fix-disk-error-log-storm-2.patch new file mode 100644 index 0000000000000000000000000000000000000000..81a00cbee9680990f3e4f6788239d0237827f45f --- /dev/null +++ b/bugfix-fix-disk-error-log-storm-2.patch @@ -0,0 +1,33 @@ +From f8abb838baa5b9f7ae2b70cdc1ec6c9d0639aa2b Mon Sep 17 00:00:00 2001 +From: jiangjixiang +Date: Mon, 3 Jul 2023 17:21:19 +0800 +Subject: [PATCH] fix diskerror flood + +The rasdaemon startup script has two startup options: ExecStart and ExecStartPost. +The ExecStart option adds filtering conditions and launches traceevent. +The ExecStartPost option is only responsible for starting traceeven. +ExecStart and ExecStartPost are two parallel processes. +When ExecStartPost is executed first, all diskerrors will be recorded. + +--- + ras-diskerror-handler.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/ras-diskerror-handler.c b/ras-diskerror-handler.c +index b16319f..06dbafb 100644 +--- a/ras-diskerror-handler.c ++++ b/ras-diskerror-handler.c +@@ -108,6 +108,10 @@ int ras_diskerror_event_handler(struct trace_seq *s, + + if (pevent_get_field_val(s, event, "error", record, &val, 1) < 0) + return -1; ++ if (0 == val) { ++ free(ev.dev); ++ return 0; ++ } + ev.error = get_blk_error((int)val); + + ev.rwbs = pevent_get_field_raw(s, event, "rwbs", record, &len, 1); +-- +2.27.0 + diff --git a/rasdaemon.spec b/rasdaemon.spec index a7dbdc9b97ef535998ce8cb16cfb8290b72c4827..0cd2ad21c27644a0fe15e7e712cb604dfa3ae0a1 100644 --- a/rasdaemon.spec +++ b/rasdaemon.spec @@ -1,6 +1,6 @@ Name: rasdaemon Version: 0.6.8 -Release: 5 +Release: 6 License: GPLv2 Summary: Utility to get Platform Reliability, Availability and Serviceability (RAS) reports via the Kernel tracing events URL: https://github.com/mchehab/rasdaemon.git @@ -43,6 +43,7 @@ Patch9016: 0001-rasdaemon-fix-return-value-type-issue-of-read-write-.patch Patch9017: 0002-rasdaemon-fix-issue-of-signed-and-unsigned-integer-c.patch Patch9018: 0003-rasdaemon-Add-support-for-creating-the-vendor-error-.patch Patch9019: 0004-rasdaemon-Add-four-modules-supported-by-HiSilicon-co.patch +Patch9020: bugfix-fix-disk-error-log-storm-2.patch %description The rasdaemon program is a daemon which monitors the platform @@ -88,6 +89,12 @@ rm INSTALL %{buildroot}/usr/include/*.h /usr/bin/systemctl enable rasdaemon.service >/dev/null 2>&1 || : %changelog +* Mon Jul 3 2023 jiangjixiang - 0.6.8-6 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix diskerror log storm. + * Sat Jun 17 2023 yanglongkang - 0.6.8-5 - Type:bugfix - ID:NA