Hi,
I just wanted to report a small problem applying kernel/2.6.26_compat.patch and
provide an updated patch to fix the problem.

If you try to compile the source from current git master branch for
kernel-2.6.26,
you will encounter patch error.
Here is what I did.


bash-3.2$ git clone
git://git.kernel.org/pub/scm/linux/kernel/git/mnc/open-iscsi.git

bash-3.2$ git log --summary | head -3
commit fb4f2d3072bee96606d01e3535c100dc99b8d331
Author: Mike Christie <micha...@cs.wisc.edu>
Date:   Wed Nov 25 18:09:39 2009 -0600

bash-3.2$ uname -r
2.6.26.8-57.laphroaig.fc8

bash-3.2$ make KSRC=/home/hiro/rpmbuild/BUILD/kernel-2.6.26/linux-2.6.26.i686/
----snip-----
make -C kernel
make[1]: Entering directory `/home/hiro/programming/git/open-iscsi/kernel'
echo "Patching source code for linux-2.6.26 ..."
Patching source code for linux-2.6.26 ...
if [ -e cur_patched ]; then \
                make -C . clean; \
        fi
patch -p1 < 2.6.26_compat.patch
patching file libiscsi.c
patching file open_iscsi_compat.h
patching file scsi_transport_iscsi.c
Hunk #1 FAILED at 30.
Hunk #2 succeeded at 146 (offset 31 lines).
Hunk #4 succeeded at 1405 (offset 92 lines).
Hunk #6 succeeded at 1548 (offset 119 lines).
Hunk #8 succeeded at 2080 (offset 123 lines).
Hunk #10 succeeded at 2134 (offset 123 lines).
1 out of 10 hunks FAILED -- saving rejects to file scsi_transport_iscsi.c.rej
make[1]: *** [has_26_patch] Error 1
make[1]: Leaving directory `/home/hiro/programming/git/open-iscsi/kernel'
make: *** [kernel] Error 2


You can see that patchihg scsi_transport_iscsi.c failed.
The problematic hunk in 2.6.26_compat.patch is
"#define ISCSI_SESSION_ATTRS 21". In the latest source file,
ISCSI_SESSION_ATTRS is "22", but that macro was left
to be "21" in the patch, so patch command fails since
it cannot find proper context.

bash-3.2$ cat kernel/2.6.26_compat.patch
----snip----
diff --git a/scsi_transport_iscsi.c b/scsi_transport_iscsi.c
index a49a92c..c07535e 100644
--- a/scsi_transport_iscsi.c
+++ b/scsi_transport_iscsi.c
@@ -30,6 +30,8 @@
 #include "scsi_transport_iscsi.h"
 #include "iscsi_if.h"

+#include "open_iscsi_compat.h"
+
 #define ISCSI_SESSION_ATTRS 21
 #define ISCSI_CONN_ATTRS 13
 #define ISCSI_HOST_ATTRS 4

bash-3.2$ cat -n kernel/scsi_transport_iscsi.c | grep "define
ISCSI_SESSION_ATTRS"
    33  #define ISCSI_SESSION_ATTRS 22

I attached the updated 2.6.26_compat.patch. Please check it.

Thanks.

Kim

--

You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-is...@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.


diff --git a/libiscsi.c b/libiscsi.c
index 0b810b6..6ffb49c 100644
--- a/libiscsi.c
+++ b/libiscsi.c
@@ -38,6 +38,8 @@
 #include "scsi_transport_iscsi.h"
 #include "libiscsi.h"
 
+#include "open_iscsi_compat.h"
+
 static int iscsi_dbg_lib_conn;
 module_param_named(debug_libiscsi_conn, iscsi_dbg_lib_conn, int,
 		   S_IRUGO | S_IWUSR);
diff --git a/scsi_transport_iscsi.c b/scsi_transport_iscsi.c
index f64ffa7..c6eeae0 100644
--- a/scsi_transport_iscsi.c
+++ b/scsi_transport_iscsi.c
@@ -30,6 +30,8 @@
 #include "scsi_transport_iscsi.h"
 #include "iscsi_if.h"
 
+#include "open_iscsi_compat.h"
+
 #define ISCSI_SESSION_ATTRS 22
 #define ISCSI_CONN_ATTRS 13
 #define ISCSI_HOST_ATTRS 4
@@ -144,6 +146,7 @@ static struct attribute_group iscsi_transport_group = {
 	.attrs = iscsi_transport_attrs,
 };
 
+#if 0
 /*
  * iSCSI endpoint attrs
  */
@@ -267,6 +270,7 @@ struct iscsi_endpoint *iscsi_lookup_endpoint(u64 handle)
 	return ep;
 }
 EXPORT_SYMBOL_GPL(iscsi_lookup_endpoint);
+#endif
 
 static int iscsi_setup_host(struct transport_container *tc, struct device *dev,
 			    struct device *cdev)
@@ -1401,6 +1405,8 @@ static int
 iscsi_if_transport_ep(struct iscsi_transport *transport,
 		      struct iscsi_uevent *ev, int msg_type)
 {
+	return -ENOSYS;
+#if 0
 	struct iscsi_endpoint *ep;
 	int rc = 0;
 
@@ -1432,6 +1438,8 @@ iscsi_if_transport_ep(struct iscsi_transport *transport,
 		break;
 	}
 	return rc;
+
+#endif
 }
 
 static int
@@ -1540,6 +1548,9 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, uint32_t *group)
 					      ev->u.c_session.queue_depth);
 		break;
 	case ISCSI_UEVENT_CREATE_BOUND_SESSION:
+		err = -ENOSYS;
+		break;
+#if 0
 		ep = iscsi_lookup_endpoint(ev->u.c_bound_session.ep_handle);
 		if (!ep) {
 			err = -EINVAL;
@@ -1551,6 +1562,7 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, uint32_t *group)
 					ev->u.c_bound_session.cmds_max,
 					ev->u.c_bound_session.queue_depth);
 		break;
+#endif
 	case ISCSI_UEVENT_DESTROY_SESSION:
 		session = iscsi_session_lookup(ev->u.d_session.sid);
 		if (session)
@@ -2068,13 +2080,14 @@ static __init int iscsi_transport_init(void)
 	if (err)
 		return err;
 
+#if 0
 	err = class_register(&iscsi_endpoint_class);
 	if (err)
 		goto unregister_transport_class;
-
+#endif
 	err = transport_class_register(&iscsi_host_class);
 	if (err)
-		goto unregister_endpoint_class;
+		goto unregister_transport_class;
 
 	err = transport_class_register(&iscsi_connection_class);
 	if (err)
@@ -2105,8 +2118,10 @@ unregister_conn_class:
 	transport_class_unregister(&iscsi_connection_class);
 unregister_host_class:
 	transport_class_unregister(&iscsi_host_class);
+#if 0
 unregister_endpoint_class:
 	class_unregister(&iscsi_endpoint_class);
+#endif
 unregister_transport_class:
 	class_unregister(&iscsi_transport_class);
 	return err;
@@ -2119,7 +2134,9 @@ static void __exit iscsi_transport_exit(void)
 	transport_class_unregister(&iscsi_connection_class);
 	transport_class_unregister(&iscsi_session_class);
 	transport_class_unregister(&iscsi_host_class);
+#if 0
 	class_unregister(&iscsi_endpoint_class);
+#endif
 	class_unregister(&iscsi_transport_class);
 }
 

Reply via email to