irqbalance/bugfix-add-keep_going-check-to-prevent-irqbalance-from-failing-to-exit-after-SIGTERM.patch
qinyu 9ba312d482 bugfix:fix potential dead loop when parsing interrupts
when parsing /proc/interrupts and if a chip name start with numbers,
current procedure would consider those  numbers as interrupt count thus
lead to miscount. Failed parsing would trigger new parsing and cause
dead loop which can't be stopped by SIGINT and SIGTERM. So fix this
by adding signal checks in loop.

Signed-off-by: qinyu <qinyu32@huawei.com>
2022-07-12 14:34:26 +08:00

26 lines
776 B
Diff

From 028082a6a1ff650d5cdf796ac55ac26a3874372a Mon Sep 17 00:00:00 2001
From: Liu Chao <liuchao173@huawei.com>
Date: Sat, 25 Jun 2022 14:13:10 +0800
Subject: [PATCH] add keep_going check to prevent irqbalance from failing to
exit after SIGTERM
Signed-off-by: Liu Chao <liuchao173@huawei.com>
---
irqbalance.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/irqbalance.c b/irqbalance.c
index c520c11..5eae5b6 100644
--- a/irqbalance.c
+++ b/irqbalance.c
@@ -290,7 +290,7 @@ gboolean scan(gpointer data __attribute__((unused)))
/* cope with cpu hotplug -- detected during /proc/interrupts parsing */
- while (need_rescan || need_rebuild) {
+ while (keep_going && (need_rescan || need_rebuild)) {
int try_times = 0;
need_rescan = 0;
--
2.23.0