reconnect: avoid deadlock if socker error is received during reconnect

If we are reconnecting and the connection is already established we
end up looping forever if there is a socket error before we finish
the login process. Fix this by invoking the reconnect callback if
there is an error and no new reconnect is scheduled.

Signed-off-by: Peter Lieven <pl@kamp.de>
This commit is contained in:
Peter Lieven
2015-04-13 12:08:08 +02:00
parent e219f1bb97
commit 913b2ab708
3 changed files with 8 additions and 2 deletions

View File

@@ -780,6 +780,9 @@ iscsi_service_reconnect_if_loggedin(struct iscsi_context *iscsi)
}
}
if (iscsi->old_iscsi) {
if (!iscsi->pending_reconnect) {
iscsi_reconnect_cb(iscsi, SCSI_STATUS_ERROR, NULL, NULL);
}
return 0;
}
return -1;