svn commit: r265521 - stable/10/sys/dev/iscsi

Edward Tomasz Napierala trasz at FreeBSD.org
Wed May 7 07:46:24 UTC 2014


Author: trasz
Date: Wed May  7 07:46:23 2014
New Revision: 265521
URL: http://svnweb.freebsd.org/changeset/base/265521

Log:
  MFC r264537:
  
  Be more strict with locking for is_waiting_for_iscsid variable.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  stable/10/sys/dev/iscsi/iscsi.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/iscsi/iscsi.c
==============================================================================
--- stable/10/sys/dev/iscsi/iscsi.c	Wed May  7 07:45:22 2014	(r265520)
+++ stable/10/sys/dev/iscsi/iscsi.c	Wed May  7 07:46:23 2014	(r265521)
@@ -1201,8 +1201,10 @@ iscsi_ioctl_daemon_wait(struct iscsi_sof
 	sx_slock(&sc->sc_lock);
 	for (;;) {
 		TAILQ_FOREACH(is, &sc->sc_sessions, is_next) {
+			ISCSI_SESSION_LOCK(is);
 			if (is->is_waiting_for_iscsid)
 				break;
+			ISCSI_SESSION_UNLOCK(is);
 		}
 
 		if (is == NULL) {
@@ -1217,7 +1219,6 @@ iscsi_ioctl_daemon_wait(struct iscsi_sof
 			continue;
 		}
 
-		ISCSI_SESSION_LOCK(is);
 		is->is_waiting_for_iscsid = false;
 		is->is_login_phase = true;
 		is->is_reason[0] = '\0';
@@ -1650,8 +1651,10 @@ iscsi_ioctl_session_add(struct iscsi_sof
 	/*
 	 * Trigger immediate reconnection.
 	 */
+	ISCSI_SESSION_LOCK(is);
 	is->is_waiting_for_iscsid = true;
 	strlcpy(is->is_reason, "Waiting for iscsid(8)", sizeof(is->is_reason));
+	ISCSI_SESSION_UNLOCK(is);
 	cv_signal(&sc->sc_cv);
 
 	sx_xunlock(&sc->sc_lock);


More information about the svn-src-all mailing list