From 95acb250e0a66e00333e3092c940c95428a83cc6 Mon Sep 17 00:00:00 2001 From: Shengwei Luo Date: Tue, 23 Apr 2024 17:24:08 +0800 Subject: [PATCH] Fix cpu isolate errors when some cpus are offline before the service started Signed-off-by: slim6882 --- ...u-isolate-errors-when-some-cpus-are-.patch | 32 +++++++++++++++++++ rasdaemon.spec | 10 +++++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 bugfix-fix-cpu-isolate-errors-when-some-cpus-are-.patch diff --git a/bugfix-fix-cpu-isolate-errors-when-some-cpus-are-.patch b/bugfix-fix-cpu-isolate-errors-when-some-cpus-are-.patch new file mode 100644 index 0000000..304dbd5 --- /dev/null +++ b/bugfix-fix-cpu-isolate-errors-when-some-cpus-are-.patch @@ -0,0 +1,32 @@ +From 77600e0cd71cd5c34126635b199e7b66f4d74874 Mon Sep 17 00:00:00 2001 +From: Shengwei Luo +Date: Tue, 23 Apr 2024 17:09:10 +0800 +Subject: [PATCH] rasdaemon: Fix cpu isolate errors when some cpus are offline + before the service started. + +The upstream patch use (sysconf(_SC_NPROCESSORS_ONLN)) instead of +(sysconf(_SC_NPROCESSORS_CONF)). However ras_cpu_isolation_init() +need the all cpu info, so fix it. + +Fixes: f1ea76375281 ("rasdaemon: Check CPUs online, not configured") +Signed-off-by: Shengwei Luo +--- + ras-events.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ras-events.c b/ras-events.c +index ffac02b..1aa6db6 100644 +--- a/ras-events.c ++++ b/ras-events.c +@@ -950,7 +950,7 @@ int handle_ras_events(int record_events) + cpus = get_num_cpus(ras); + + #ifdef HAVE_CPU_FAULT_ISOLATION +- ras_cpu_isolation_init(cpus); ++ ras_cpu_isolation_init(sysconf(_SC_NPROCESSORS_CONF)); + #endif + + #ifdef HAVE_MCE +-- +2.33.0 + diff --git a/rasdaemon.spec b/rasdaemon.spec index f6b4718..4e7cff8 100644 --- a/rasdaemon.spec +++ b/rasdaemon.spec @@ -1,6 +1,6 @@ Name: rasdaemon Version: 0.6.7 -Release: 17 +Release: 18 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 @@ -44,6 +44,7 @@ Patch22: 0002-rasdaemon-fix-issue-of-signed-and-unsigned-integer-c.patch Patch23: 0001-rasdaemon-ras-mc-ctl-Modify-check-for-HiSilicon-KunP.patch Patch24: 0001-Check-CPUs-online-not-configured.patch Patch25: backport-Fix-potential-overflow-with-some-arrays-at-page-isol.patch +Patch26: bugfix-fix-cpu-isolate-errors-when-some-cpus-are-.patch Patch6000: backport-rasdaemon-ras-mc-ctl-Fix-script-to-parse-dimm-sizes.patch Patch6001: backport-rasdaemon-ras-memory-failure-handler-handle-localtim.patch @@ -108,6 +109,13 @@ if [ $1 -eq 0 ] ; then fi %changelog +* Thu Apr 25 2024 yangjunshuo - 0.6.7-18 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix cpu isolate errors when some cpus are offline + before the service started + * Mon Apr 8 2024 caixiaomeng - 0.6.7-17 - Type:bugfix - ID:NA -- Gitee