uring: fix the assert issue.

Revise the if case to avoid the assert issue.

Change-Id: I095f3d111423e17abaa1f951fe22efb3d2e851b7
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8872
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Ziye Yang 2021-07-22 03:24:48 +08:00 committed by Tomasz Zawadzki
parent 250b2ba025
commit 5a169179be

View File

@ -907,8 +907,8 @@ sock_uring_group_reap(struct spdk_uring_sock_group_impl *group, int max, int max
switch (task->type) {
case SPDK_SOCK_TASK_POLLIN:
if ((status & POLLIN) == POLLIN) {
if (sock->base.cb_fn != NULL) {
assert(sock->pending_recv == false);
if (sock->base.cb_fn != NULL &&
sock->pending_recv == false) {
sock->pending_recv = true;
TAILQ_INSERT_TAIL(&group->pending_recv, sock, link);
}