irqbalance/0005-activate_mapping-report-error-reason.patch
Tao Liu d7861c8775 Release 1.9.2-2
Rebase to latest upstream commit (50699824c7)
Resolves:rhbz2184735

Signed-off-by: Tao Liu <ltao@redhat.com>
2023-07-18 09:24:18 +08:00

65 lines
1.6 KiB
Diff

From 9a1fd29a82c9762c3676f613075d44a8d1fcbe82 Mon Sep 17 00:00:00 2001
From: Robin Jarry <rjarry@redhat.com>
Date: Wed, 12 Jul 2023 08:59:45 +0200
Subject: [PATCH 5/7] activate_mapping: report error reason
If a given IRQ affinity cannot be set, include strerror in the warning
message.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2184735
Signed-off-by: Robin Jarry <rjarry@redhat.com>
---
activate.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/activate.c b/activate.c
index a4112e0..4418cda 100644
--- a/activate.c
+++ b/activate.c
@@ -25,10 +25,12 @@
* of interrupts to the kernel.
*/
#include "config.h"
+#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdint.h>
+#include <string.h>
#include "irqbalance.h"
@@ -48,7 +50,7 @@ static void activate_mapping(struct irq_info *info, void *data __attribute__((un
{
char buf[PATH_MAX];
FILE *file;
- int ret = 0;
+ int errsave, ret;
cpumask_t applied_mask;
/*
@@ -79,11 +81,18 @@ static void activate_mapping(struct irq_info *info, void *data __attribute__((un
cpumask_scnprintf(buf, PATH_MAX, applied_mask);
ret = fprintf(file, "%s", buf);
- if (fclose(file) || ret < 0)
+ errsave = errno;
+ if (fclose(file)) {
+ errsave = errno;
+ goto error;
+ }
+ if (ret < 0)
goto error;
info->moved = 0; /*migration is done*/
error:
- log(TO_ALL, LOG_WARNING, "cannot change IRQ %i affinity, will never try again\n", info->irq);
+ log(TO_ALL, LOG_WARNING,
+ "Cannot change IRQ %i affinity: %s. Will never try again.\n",
+ info->irq, strerror(errsave));
info->flags |= IRQ_FLAG_AFFINITY_UNMANAGED;
}
--
2.40.1