From 103fe9156d0f539cd8a36a2e9caecaf0fb71c047 Mon Sep 17 00:00:00 2001 From: jiangjixiang Date: Mon, 3 Jul 2023 17:35:34 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E4=B8=AD=E5=AD=98=E5=9C=A8=E5=A4=A7=E9=87=8Frasdaemon=20disker?= =?UTF-8?q?ror=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bugfix-fix-disk-error-log-storm-2.patch | 33 +++++++++++++++++++++++++ rasdaemon.spec | 9 ++++++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 bugfix-fix-disk-error-log-storm-2.patch 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 0000000..a901926 --- /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. + +--- + rasdaemon-0.6.8/ras-diskerror-handler.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/rasdaemon-0.6.8/ras-diskerror-handler.c b/rasdaemon-0.6.8/ras-diskerror-handler.c +index b16319f..06dbafb 100644 +--- a/rasdaemon-0.6.8/ras-diskerror-handler.c ++++ b/rasdaemon-0.6.8/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 a7dbdc9..0cd2ad2 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 -- Gitee From d690e114f65f9d005bff80f0cc5c3712c8907291 Mon Sep 17 00:00:00 2001 From: jiangjixiang Date: Mon, 3 Jul 2023 17:35:34 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E4=B8=AD=E5=AD=98=E5=9C=A8=E5=A4=A7=E9=87=8Frasdaemon=20disker?= =?UTF-8?q?ror=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bugfix-fix-disk-error-log-storm-2.patch | 33 +++++++++++++++++++++++++ rasdaemon.spec | 9 ++++++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 bugfix-fix-disk-error-log-storm-2.patch 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 0000000..81a00cb --- /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 a7dbdc9..0cd2ad2 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 -- Gitee