Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Dec 2013 15:25:51 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r259306 - stable/10/sys/dev/iscsi
Message-ID:  <201312131525.rBDFPp5e093648@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Fri Dec 13 15:25:51 2013
New Revision: 259306
URL: http://svnweb.freebsd.org/changeset/base/259306

Log:
  MFC r259183:
  
  Properly refuse handoff requests on already connected sessions.  Previously
  this would result in dropping the session.
  
  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	Fri Dec 13 15:23:07 2013	(r259305)
+++ stable/10/sys/dev/iscsi/iscsi.c	Fri Dec 13 15:25:51 2013	(r259306)
@@ -1247,6 +1247,18 @@ iscsi_ioctl_daemon_handoff(struct iscsi_
 		sx_sunlock(&sc->sc_lock);
 		return (EINVAL);
 	}
+	if (is->is_connected) {
+		/*
+		 * This might have happened because another iscsid(8)
+		 * instance handed off the connection in the meantime.
+		 * Just return.
+		 */
+		ISCSI_SESSION_WARN(is, "handoff on already connected "
+		    "session");
+		ISCSI_SESSION_UNLOCK(is);
+		sx_sunlock(&sc->sc_lock);
+		return (EBUSY);
+	}
 
 	strlcpy(is->is_target_alias, handoff->idh_target_alias,
 	    sizeof(is->is_target_alias));



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