Author: trasz
Date: Thu May 19 14:37:24 2016
New Revision: 300209
URL: https://svnweb.freebsd.org/changeset/base/300209

Log:
  Make it possible to interrupt proxy-mode iscsid receive.
  
  MFC after:    1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/iscsi/iscsi.c

Modified: head/sys/dev/iscsi/iscsi.c
==============================================================================
--- head/sys/dev/iscsi/iscsi.c  Thu May 19 14:19:01 2016        (r300208)
+++ head/sys/dev/iscsi/iscsi.c  Thu May 19 14:37:24 2016        (r300209)
@@ -1634,6 +1634,7 @@ iscsi_ioctl_daemon_receive(struct iscsi_
        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_
        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);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to