Make it possible to interrupt proxy-mode iscsid receive.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Edward Tomasz Napierala 2016-05-19 14:37:24 +00:00
parent cfce4fbe6f
commit 2f0586b2ce

View File

@ -1634,6 +1634,7 @@ iscsi_ioctl_daemon_receive(struct iscsi_softc *sc,
struct iscsi_session *is;
struct icl_pdu *ip;
void *data;
int error;
sx_slock(&sc->sc_lock);
TAILQ_FOREACH(is, &sc->sc_sessions, is_next) {
@ -1652,8 +1653,13 @@ iscsi_ioctl_daemon_receive(struct iscsi_softc *sc,
ISCSI_SESSION_LOCK(is);
while (is->is_login_pdu == NULL &&
is->is_terminating == false &&
is->is_reconnecting == false)
cv_wait(&is->is_login_cv, &is->is_lock);
is->is_reconnecting == false) {
error = cv_wait_sig(&is->is_login_cv, &is->is_lock);
if (error != 0) {
ISCSI_SESSION_UNLOCK(is);
return (error);
}
}
if (is->is_terminating || is->is_reconnecting) {
ISCSI_SESSION_UNLOCK(is);
return (EIO);