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>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1275 (master)
(cherry picked from commit 628dc9c162
)
Change-Id: Idffd90cd6ee8e6cb4298fe3f1363d8d5c5a3c49d
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1355
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
7976cae3b4
commit
136c0771ad
@ -1138,6 +1138,11 @@ iscsi_conn_login_pdu_success_complete(void *arg)
|
|||||||
{
|
{
|
||||||
struct spdk_iscsi_conn *conn = 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 (conn->full_feature) {
|
||||||
if (iscsi_conn_params_update(conn) != 0) {
|
if (iscsi_conn_params_update(conn) != 0) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user