Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Sep 2018 11:39:59 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r338586 - head/sys/cam/ctl
Message-ID:  <201809111139.w8BBdxAf074005@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Tue Sep 11 11:39:59 2018
New Revision: 338586
URL: https://svnweb.freebsd.org/changeset/base/338586

Log:
  Make the wait in cfiscsi_offline() interruptible.  This is the second half
  of the fix/workaround for the "ctld hanging on reload" problem.
  
  PR:		220175
  Reported by:	Eugene M. Zheganin <emz at norma.perm.ru>
  Tested by:	Eugene M. Zheganin <emz at norma.perm.ru>
  Approved by:	re (kib)
  MFC after:	2 weeks
  Sponsored by:	playkey.net

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Tue Sep 11 10:10:25 2018	(r338585)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Tue Sep 11 11:39:59 2018	(r338586)
@@ -1434,7 +1434,7 @@ cfiscsi_offline(void *arg)
 	struct cfiscsi_softc *softc;
 	struct cfiscsi_target *ct;
 	struct cfiscsi_session *cs;
-	int online;
+	int error, online;
 
 	ct = (struct cfiscsi_target *)arg;
 	softc = ct->ct_softc;
@@ -1456,8 +1456,14 @@ cfiscsi_offline(void *arg)
 			if (cs->cs_target == ct)
 				break;
 		}
-		if (cs != NULL)
-			cv_wait(&softc->sessions_cv, &softc->lock);
+		if (cs != NULL) {
+			error = cv_wait_sig(&softc->sessions_cv, &softc->lock);
+			if (error != 0) {
+				CFISCSI_SESSION_DEBUG(cs,
+				    "cv_wait failed with error %d\n", error);
+				break;
+			}
+		}
 	} while (cs != NULL && ct->ct_online == 0);
 	mtx_unlock(&softc->lock);
 	if (online > 0)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201809111139.w8BBdxAf074005>