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 <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: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
86d7e4dc18
commit
e128476793
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user