From 86428134031ed9a431c0219332ca2b5bd3d771a0 Mon Sep 17 00:00:00 2001 From: Ziye Yang Date: Fri, 2 Mar 2018 02:12:09 +0800 Subject: [PATCH] lib/iscsi: add a check in spdk_iscsi_conn_sock_cb Since we have two pollers for each iSCSI polling group, so it could be possible that the nop_poller to set iSCSI connection in existed or existing state. So add a check here, which means the incoming data is too late. Change-Id: I94e5090b005c35c9eb5d7eedbd7acdae67327f94 Signed-off-by: Ziye Yang Reviewed-on: https://review.gerrithub.io/402039 Tested-by: SPDK Automated Test System Reviewed-by: Jim Harris Reviewed-by: Daniel Verkamp Reviewed-by: Shuhei Matsumoto --- lib/iscsi/conn.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/iscsi/conn.c b/lib/iscsi/conn.c index 2d922a996..85816d659 100644 --- a/lib/iscsi/conn.c +++ b/lib/iscsi/conn.c @@ -1150,6 +1150,11 @@ spdk_iscsi_conn_sock_cb(void *arg, struct spdk_sock_group *group, struct spdk_so assert(conn != NULL); + if ((conn->state == ISCSI_CONN_STATE_EXITED) || + (conn->state == ISCSI_CONN_STATE_EXITING)) { + return; + } + /* Handle incoming PDUs */ rc = spdk_iscsi_conn_handle_incoming_pdus(conn); if (rc < 0) {