From c833729b22b0eff4e043a7ca9f8521652722b09e Mon Sep 17 00:00:00 2001 From: Ziye Yang Date: Thu, 25 Jun 2020 07:18:07 +0800 Subject: [PATCH] sock/uring: Fix the nvmf_shutdown_tc3 failure issue. If the socks parameter(passed in uring_sock_group_impl_poll) is NULL, we do not need to handle the sock_flush and prep the pollin task, otherwise it will cause the assert issue when we reap the task when we handle the nvmf_shutdown_tc3 issue. Because in uring_sock_group_impl_remove_sock, we finally set sock->group = NULL. Without this patch, when we call uring_sock_group_impl_poll in this function, pollin_task or write_task are prepared, then in the next round, we will reap those tasks again. PS: Error info can be found in https://ci.spdk.io/results/autotest-per-patch/builds/19186/archive/nvmf-tcp-vg-autotest/build.log Signed-off-by: Ziye Yang Change-Id: I7e6deaa05e958b52e71e0bbf0ccdd20e35583685 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3031 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto Reviewed-by: Aleksey Marchuk --- module/sock/uring/uring.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/module/sock/uring/uring.c b/module/sock/uring/uring.c index e1248421a..867544da8 100644 --- a/module/sock/uring/uring.c +++ b/module/sock/uring/uring.c @@ -1199,13 +1199,15 @@ uring_sock_group_impl_poll(struct spdk_sock_group_impl *_group, int max_events, struct spdk_sock *_sock, *tmp; struct spdk_uring_sock *sock; - TAILQ_FOREACH_SAFE(_sock, &group->base.socks, link, tmp) { - sock = __uring_sock(_sock); - if (spdk_unlikely(sock->connection_status)) { - continue; + if (spdk_likely(socks)) { + TAILQ_FOREACH_SAFE(_sock, &group->base.socks, link, tmp) { + sock = __uring_sock(_sock); + if (spdk_unlikely(sock->connection_status)) { + continue; + } + _sock_flush(_sock); + _sock_prep_pollin(_sock); } - _sock_flush(_sock); - _sock_prep_pollin(_sock); } to_submit = group->io_queued;