diff --git a/module/sock/posix/posix.c b/module/sock/posix/posix.c index c180a169e..58f66df1f 100644 --- a/module/sock/posix/posix.c +++ b/module/sock/posix/posix.c @@ -658,6 +658,7 @@ static int _sock_check_zcopy(struct spdk_sock *sock) { struct spdk_posix_sock *psock = __posix_sock(sock); + struct spdk_posix_sock_group_impl *group = __posix_group_impl(sock->group_impl); struct msghdr msgh = {}; uint8_t buf[sizeof(struct cmsghdr) + sizeof(struct sock_extended_err)]; ssize_t rc; @@ -721,6 +722,12 @@ _sock_check_zcopy(struct spdk_sock *sock) } } + /* If we reaped buffer reclaim notification and sock is not in pending_recv list yet, + * add it now. It allows to call socket callback and process completions */ + if (found && !psock->pending_recv) { + psock->pending_recv = true; + TAILQ_INSERT_TAIL(&group->pending_recv, psock, link); + } } }