Commit e1284767 authored by John Levon's avatar John Levon Committed by Tomasz Zawadzki
Browse files

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: default avatarJohn Levon <john.levon@nutanix.com>
Change-Id: Idcd810d2b3f644bab1514063b399b9767797130f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9388


Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarXiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent 86d7e4dc
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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;
	}