lib/iscsi: Return when connection state is already exited at login completion
iSCSI target got segmentation fault if connection is being exited between spdk_iscsi_conn_write_pdu() and its callback iscsi_conn_login_pdu_success_complete() are executed. This was caused by recent asynchronous socket write feature. Fixes issue #1278. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: Idffd90cd6ee8e6cb4298fe3f1363d8d5c5a3c49d Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1275 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ziye Yang <ziye.yang@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: wanghailiang <hailiangx.e.wang@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
863d73d34b
commit
628dc9c162
@ -1138,6 +1138,11 @@ iscsi_conn_login_pdu_success_complete(void *arg)
|
||||
{
|
||||
struct spdk_iscsi_conn *conn = arg;
|
||||
|
||||
if (conn->state >= ISCSI_CONN_STATE_EXITING) {
|
||||
/* Connection is being exited before this callback is executed. */
|
||||
SPDK_DEBUGLOG(SPDK_LOG_ISCSI, "Connection is already exited.\n");
|
||||
return;
|
||||
}
|
||||
if (conn->full_feature) {
|
||||
if (iscsi_conn_params_update(conn) != 0) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user