From 5a169179be2954d1a71a6af82336b706bad01b91 Mon Sep 17 00:00:00 2001 From: Ziye Yang Date: Thu, 22 Jul 2021 03:24:48 +0800 Subject: [PATCH] uring: fix the assert issue. Revise the if case to avoid the assert issue. Change-Id: I095f3d111423e17abaa1f951fe22efb3d2e851b7 Signed-off-by: Ziye Yang Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8872 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Reviewed-by: Aleksey Marchuk Reviewed-by: Tomasz Zawadzki --- module/sock/uring/uring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/sock/uring/uring.c b/module/sock/uring/uring.c index 301f84825..3d8d66312 100644 --- a/module/sock/uring/uring.c +++ b/module/sock/uring/uring.c @@ -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); }