From 2f0586b2ce5a8f582ad7c7388d056faeca194d6e Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Thu, 19 May 2016 14:37:24 +0000 Subject: [PATCH] Make it possible to interrupt proxy-mode iscsid receive. MFC after: 1 month Sponsored by: The FreeBSD Foundation --- sys/dev/iscsi/iscsi.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c index 62a9c32c5577..e8c59e761c3a 100644 --- a/sys/dev/iscsi/iscsi.c +++ b/sys/dev/iscsi/iscsi.c @@ -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);