Mike Christie wrote:
>> [in another mail]
>>> Oh yeah the userspace tools from 869.2 should work with
>>> 2.6.26-rc3.
>> This is important, thanks.  Userspace git head fails with stock
>> 2.6.26-rc3 due to the introduction of
>> ISCSI_UEVENT_CREATE_BOUND_SESSION in "pass ep to session
>> creation".  Guess I should pull in your git kernel tree too.
>>
> 
> It should not fail. We should drop down to the old behavior. I will 
> check that out. I think I forgot to copy over a fix from tcp to iser for 
> compat support.
> 

Here is patch over git head which fixes the problem for me. Sorry about 
that.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~----------~----~----~----~------~----~------~--~---

diff --git a/usr/initiator.c b/usr/initiator.c
index 9c3eb49..3048340 100644
--- a/usr/initiator.c
+++ b/usr/initiator.c
@@ -1687,18 +1687,29 @@ static void session_conn_recv_pdu(void *data)
 static int session_ipc_create(struct iscsi_session *session)
 {
 	struct iscsi_conn *conn = &session->conn[0];
-	int err = 0, kern_ep = 1;
+	int err = 0, pass_ep = 1;
 	uint32_t host_no = -1;
 
-	if (session->t->template->ep_connect == iscsi_io_tcp_connect)
-		kern_ep = 0;
-
+	if (session->t->template->ep_connect != ktransport_ep_connect)
+		pass_ep = 0;
+retry_create:
 	err = ipc->create_session(session->t->handle,
-				  kern_ep ? conn->transport_ep_handle : 0,
+				  pass_ep ? conn->transport_ep_handle : 0,
 				  session->nrec.session.initial_cmdsn,
 				  session->nrec.session.cmds_max,
 				  session->nrec.session.queue_depth,
 				  &session->id, &host_no);
+	/*
+	 * Older kernels were not passed the sessions's leading conn ep,
+	 * so we will get -EINVAL || -ENOSYS for iser.
+	 *
+	 * 2.6.22 and earlier would send -EINVAL instead of -ENOSYS.
+	 */
+	if (pass_ep && (err == -ENOSYS || err == -EINVAL)) {
+		pass_ep = 0;
+		goto retry_create;
+	}
+
 	if (!err)
 		session->hostno = host_no;
 	return err;

Reply via email to