From e128476793d6cbb433e78b273df10a51191e0009 Mon Sep 17 00:00:00 2001 From: John Levon Date: Fri, 3 Sep 2021 11:39:26 +0100 Subject: [PATCH] lib/thread: report error when adding to fd group We report other errors in spdk_interrupt_register(), so add one if there is an issue with adding the given efd to the fd group. Signed-off-by: John Levon Change-Id: Idcd810d2b3f644bab1514063b399b9767797130f Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9388 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Xiaodong Liu Reviewed-by: Jim Harris Reviewed-by: Tomasz Zawadzki --- lib/thread/thread.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/thread/thread.c b/lib/thread/thread.c index 21039828a..52f6e1762 100644 --- a/lib/thread/thread.c +++ b/lib/thread/thread.c @@ -2497,6 +2497,7 @@ spdk_interrupt_register(int efd, spdk_interrupt_fn fn, { struct spdk_thread *thread; struct spdk_interrupt *intr; + int ret; thread = spdk_get_thread(); if (!thread) { @@ -2509,7 +2510,11 @@ spdk_interrupt_register(int efd, spdk_interrupt_fn fn, return NULL; } - if (spdk_fd_group_add(thread->fgrp, efd, fn, arg)) { + ret = spdk_fd_group_add(thread->fgrp, efd, fn, arg); + + if (ret != 0) { + SPDK_ERRLOG("thread %s: failed to add fd %d: %s\n", + thread->name, efd, spdk_strerror(-ret)); return NULL; }