From owner-svn-src-all@freebsd.org Fri May 20 17:38:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8F2FB4429F; Fri, 20 May 2016 17:38:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 562531A70; Fri, 20 May 2016 17:38:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4KHcqDA086875; Fri, 20 May 2016 17:38:52 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KHcqY6086873; Fri, 20 May 2016 17:38:52 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605201738.u4KHcqY6086873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 20 May 2016 17:38:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300315 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 17:38:53 -0000 Author: trasz Date: Fri May 20 17:38:51 2016 New Revision: 300315 URL: https://svnweb.freebsd.org/changeset/base/300315 Log: Call the ICL module's handoff method even when using ICL proxy. The upcoming iSER code uses this. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/icl_soft.c head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/icl_soft.c ============================================================================== --- head/sys/dev/iscsi/icl_soft.c Fri May 20 17:38:45 2016 (r300314) +++ head/sys/dev/iscsi/icl_soft.c Fri May 20 17:38:51 2016 (r300315) @@ -1327,6 +1327,23 @@ icl_soft_conn_handoff(struct icl_conn *i ICL_CONN_LOCK_ASSERT_NOT(ic); +#ifdef ICL_KERNEL_PROXY + /* + * We're transitioning to Full Feature phase, and we don't + * really care. + */ + if (fd == 0) { + ICL_CONN_LOCK(ic); + if (ic->ic_socket == NULL) { + ICL_CONN_UNLOCK(ic); + ICL_WARN("proxy handoff without connect"); + return (EINVAL); + } + ICL_CONN_UNLOCK(ic); + return (0); + } +#endif + /* * Steal the socket from userland. */ Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Fri May 20 17:38:45 2016 (r300314) +++ head/sys/dev/iscsi/iscsi.c Fri May 20 17:38:51 2016 (r300315) @@ -1415,21 +1415,17 @@ iscsi_ioctl_daemon_handoff(struct iscsi_ ISCSI_SESSION_UNLOCK(is); -#ifdef ICL_KERNEL_PROXY - if (handoff->idh_socket != 0) { -#endif - /* - * Handoff without using ICL proxy. - */ - error = icl_conn_handoff(ic, handoff->idh_socket); - if (error != 0) { - sx_sunlock(&sc->sc_lock); - iscsi_session_terminate(is); - return (error); - } -#ifdef ICL_KERNEL_PROXY + /* + * If we're going through the proxy, the idh_socket will be 0, + * and the ICL module can simply ignore this call. It can also + * use it to determine it's no longer in the Login phase. + */ + error = icl_conn_handoff(ic, handoff->idh_socket); + if (error != 0) { + sx_sunlock(&sc->sc_lock); + iscsi_session_terminate(is); + return (error); } -#endif sx_sunlock(&sc->sc_lock);