From 78143515395cfae934c7c041570572d8c848f77d Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Tue, 8 Oct 2019 08:52:03 +0900 Subject: [PATCH] lib/iscsi: Consolidate call spdk_iscsi_conn_destruct() in a single place Change logout_timeout() not to call spdk_iscsi_conn_construct() but to move conn->state to EXITING. Then spdk_iscsi_conn_destruct() will be called by the poller of iSCSI poll group, iscsi_poll_group_poll() soon. This will improve the maitainability slightly. Signed-off-by: Shuhei Matsumoto Change-Id: I78046ae5ad7992ad6c7509884f964d2eff6ced76 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470704 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Changpeng Liu --- lib/iscsi/conn.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/iscsi/conn.c b/lib/iscsi/conn.c index 972faa2c6..269d2bacf 100644 --- a/lib/iscsi/conn.c +++ b/lib/iscsi/conn.c @@ -1491,7 +1491,9 @@ logout_timeout(void *arg) { struct spdk_iscsi_conn *conn = arg; - spdk_iscsi_conn_destruct(conn); + if (conn->state < ISCSI_CONN_STATE_EXITING) { + conn->state = ISCSI_CONN_STATE_EXITING; + } return -1; }