aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/iscsi
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2016-05-20 17:38:51 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2016-05-20 17:38:51 +0000
commit906a424b26cf9d9bbe8ddaf30199d1c1c5dc565c (patch)
tree5fa2e6399b16bf2d2e0fd2608aeec8ce0bc70f32 /sys/dev/iscsi
parentdd8214827f2354e4a8a8ddc4d4a6d34cde0e1e3a (diff)
downloadsrc-906a424b26cf9d9bbe8ddaf30199d1c1c5dc565c.tar.gz
src-906a424b26cf9d9bbe8ddaf30199d1c1c5dc565c.zip
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
Notes
Notes: svn path=/head/; revision=300315
Diffstat (limited to 'sys/dev/iscsi')
-rw-r--r--sys/dev/iscsi/icl_soft.c17
-rw-r--r--sys/dev/iscsi/iscsi.c24
2 files changed, 27 insertions, 14 deletions
diff --git a/sys/dev/iscsi/icl_soft.c b/sys/dev/iscsi/icl_soft.c
index 121637572393..84fecb65f52d 100644
--- a/sys/dev/iscsi/icl_soft.c
+++ b/sys/dev/iscsi/icl_soft.c
@@ -1327,6 +1327,23 @@ icl_soft_conn_handoff(struct icl_conn *ic, int fd)
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.
*/
diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c
index eae6eaaebe95..85ecdc0b87e3 100644
--- a/sys/dev/iscsi/iscsi.c
+++ b/sys/dev/iscsi/iscsi.c
@@ -1415,21 +1415,17 @@ iscsi_ioctl_daemon_handoff(struct iscsi_softc *sc,
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);