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 <ziye.yang@intel.com>
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 <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
Ziye Yang 2020-06-25 07:18:07 +08:00 committed by Tomasz Zawadzki
parent 74050eacd7
commit c833729b22

View File

@ -1199,6 +1199,7 @@ uring_sock_group_impl_poll(struct spdk_sock_group_impl *_group, int max_events,
struct spdk_sock *_sock, *tmp; struct spdk_sock *_sock, *tmp;
struct spdk_uring_sock *sock; struct spdk_uring_sock *sock;
if (spdk_likely(socks)) {
TAILQ_FOREACH_SAFE(_sock, &group->base.socks, link, tmp) { TAILQ_FOREACH_SAFE(_sock, &group->base.socks, link, tmp) {
sock = __uring_sock(_sock); sock = __uring_sock(_sock);
if (spdk_unlikely(sock->connection_status)) { if (spdk_unlikely(sock->connection_status)) {
@ -1207,6 +1208,7 @@ uring_sock_group_impl_poll(struct spdk_sock_group_impl *_group, int max_events,
_sock_flush(_sock); _sock_flush(_sock);
_sock_prep_pollin(_sock); _sock_prep_pollin(_sock);
} }
}
to_submit = group->io_queued; to_submit = group->io_queued;