sock/posix: return error immediately if epoll_ctl fails

We do not want to do any further work on adding
the sock to the group if the epoll_ctl (or kevent)
fails.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I44b6dc86ce5676aa1b8d6c50b86f22758e4e37fa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7594
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
This commit is contained in:
Jim Harris 2021-04-23 19:52:29 +00:00 committed by Tomasz Zawadzki
parent b9563518c6
commit 0e4690236b

View File

@ -1181,6 +1181,10 @@ posix_sock_group_impl_add_sock(struct spdk_sock_group_impl *_group, struct spdk_
rc = kevent(group->fd, &event, 1, NULL, 0, &ts);
#endif
if (rc != 0) {
return rc;
}
/* switched from another polling group due to scheduling */
if (spdk_unlikely(sock->recv_pipe != NULL &&
(spdk_pipe_reader_bytes_available(sock->recv_pipe) > 0))) {