Re: [PATCH] Add compat patch for RHEL 5.2

2008-09-02 Thread Hannes Reinecke

Hi Mike,

Mike Christie wrote:
 Erez Zilber wrote:
 On Mon, Aug 4, 2008 at 7:30 PM, Mike Christie [EMAIL PROTECTED] 
 wrote:
 Erez Zilber wrote:
 On Wed, Jul 16, 2008 at 8:26 PM, Mike Christie 
 [EMAIL PROTECTED] wrote:
 Erez Zilber wrote:
 On Tue, Jul 15, 2008 at 3:42 AM, Mike Christie 
 [EMAIL PROTECTED] wrote:
 Erez Zilber wrote:
 On Wed, Jul 9, 2008 at 11:22 AM, Erez Zilber 
 [EMAIL PROTECTED] wrote:
 RHEL 5.2 is based on kernel version 2.6.18, but contains code
 that wasn't included in 2.6.18 vanilla. The kernel Makefile uses
 2.6.14-19_compat.patch for it, and this creates compilation errors
 of symbol redefinition. We should have a separate compat patch for
 RHEL 5.2.

 Signed-off-by: Erez Zilber [EMAIL PROTECTED]

 Mike,

 Any news about this patch?

 Sorry for the delay.

 I was trying to make it more generic, because we have similar 
 issues on
 SUSE and we have similar issues on multiple RHEL5 kernels.
 OK - what do you suggest?
 I do not know. At least can we add ifdefs in the existing patches to
 detect distro kernels? Can you do

 ifdef kernel version = 2.6.18-92

 so we at least do not need to have multiple distro patches?
 Sorry for the long delay. I've attached a new patch that doesn't add a
 No prbolem. Thanks for doing this.

 new compat patch. I have only CentOS 5.2, so I wasn't able to test it
 on other kernels. On CentOS 5.2 it looks fine.

 Thanks a lot. I am testing it now on the kernels.

 Mike,

 Any news about that?

 
 
 I was waiting for Hannes. Hannes, is the only problem with the compat 
 patches on SLES the scsi cmnd or scatterlist helpers?
 
Various bits and pieces. For SLES10 SP2 I've updated the SCSI stack
to 2.6.22, so while the kernel version is still 2.6.16 the SCSI
midlayer is actually 2.6.22, hence the backport.

 Is there a way I can just add ifdefs to check for SLES kernels? Which 
 ones are they?
 
Sure:

We have CONFIG_SLE_VERSION and CONFIG_SLE_SP. So you should test for
CONFIG_SLE_VERSION == 10  CONFIG_SLE_SP = 2.

Cheers,

Hannes




--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: [PATCH] Add compat patch for RHEL 5.2

2008-08-25 Thread Mike Christie

Hannes Reinecke wrote:
 Hi Mike,
 
 Mike Christie wrote:
 Erez Zilber wrote:
 On Mon, Aug 4, 2008 at 7:30 PM, Mike Christie [EMAIL PROTECTED] 
 wrote:
 Erez Zilber wrote:
 On Wed, Jul 16, 2008 at 8:26 PM, Mike Christie 
 [EMAIL PROTECTED] wrote:
 Erez Zilber wrote:
 On Tue, Jul 15, 2008 at 3:42 AM, Mike Christie 
 [EMAIL PROTECTED] wrote:
 Erez Zilber wrote:
 On Wed, Jul 9, 2008 at 11:22 AM, Erez Zilber 
 [EMAIL PROTECTED] wrote:
 RHEL 5.2 is based on kernel version 2.6.18, but contains code
 that wasn't included in 2.6.18 vanilla. The kernel Makefile uses
 2.6.14-19_compat.patch for it, and this creates compilation 
 errors
 of symbol redefinition. We should have a separate compat patch 
 for
 RHEL 5.2.

 Signed-off-by: Erez Zilber [EMAIL PROTECTED]

 Mike,

 Any news about this patch?

 Sorry for the delay.

 I was trying to make it more generic, because we have similar 
 issues on
 SUSE and we have similar issues on multiple RHEL5 kernels.
 OK - what do you suggest?
 I do not know. At least can we add ifdefs in the existing patches to
 detect distro kernels? Can you do

 ifdef kernel version = 2.6.18-92

 so we at least do not need to have multiple distro patches?
 Sorry for the long delay. I've attached a new patch that doesn't add a
 No prbolem. Thanks for doing this.

 new compat patch. I have only CentOS 5.2, so I wasn't able to test it
 on other kernels. On CentOS 5.2 it looks fine.

 Thanks a lot. I am testing it now on the kernels.

 Mike,

 Any news about that?



 I was waiting for Hannes. Hannes, is the only problem with the compat 
 patches on SLES the scsi cmnd or scatterlist helpers?

 Various bits and pieces. For SLES10 SP2 I've updated the SCSI stack
 to 2.6.22, so while the kernel version is still 2.6.16 the SCSI
 midlayer is actually 2.6.22, hence the backport.
 
 Is there a way I can just add ifdefs to check for SLES kernels? Which 
 ones are they?

 Sure:
 
 We have CONFIG_SLE_VERSION and CONFIG_SLE_SP. So you should test for
 CONFIG_SLE_VERSION == 10  CONFIG_SLE_SP = 2.
 

Thanks. Will do that for the next release.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: [PATCH] Add compat patch for RHEL 5.2

2008-07-15 Thread Erez Zilber

On Tue, Jul 15, 2008 at 3:42 AM, Mike Christie [EMAIL PROTECTED] wrote:

 Erez Zilber wrote:
 On Wed, Jul 9, 2008 at 11:22 AM, Erez Zilber [EMAIL PROTECTED] wrote:
 RHEL 5.2 is based on kernel version 2.6.18, but contains code
 that wasn't included in 2.6.18 vanilla. The kernel Makefile uses
 2.6.14-19_compat.patch for it, and this creates compilation errors
 of symbol redefinition. We should have a separate compat patch for
 RHEL 5.2.

 Signed-off-by: Erez Zilber [EMAIL PROTECTED]


 Mike,

 Any news about this patch?


 Sorry for the delay.

 I was trying to make it more generic, because we have similar issues on
 SUSE and we have similar issues on multiple RHEL5 kernels.

OK - what do you suggest?


 I also think you might have sent the wrong patch, or I was not sure what
  you were trying to fix.

 The problem I hit with distro kernels like RHEL are the following:

 1. Redefinition of is_power_of_2
 2. Redefinition of shost_priv
 3. Redefintion of scsi_set_resid

Note that 2.6.18-92.el5_compat.patch (maybe deserves a better name) is
very similar to 2.6.14-19 except for some functions that I removed
(e.g. is_power_of_2). The kernel Makefile patch uses this compat patch
for RHEL 5.2, so the redefinition problem is solved.

Erez

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: [PATCH] Add compat patch for RHEL 5.2

2008-07-14 Thread Mike Christie

Erez Zilber wrote:
 On Wed, Jul 9, 2008 at 11:22 AM, Erez Zilber [EMAIL PROTECTED] wrote:
 RHEL 5.2 is based on kernel version 2.6.18, but contains code
 that wasn't included in 2.6.18 vanilla. The kernel Makefile uses
 2.6.14-19_compat.patch for it, and this creates compilation errors
 of symbol redefinition. We should have a separate compat patch for
 RHEL 5.2.

 Signed-off-by: Erez Zilber [EMAIL PROTECTED]

 
 Mike,
 
 Any news about this patch?
 

Sorry for the delay.

I was trying to make it more generic, because we have similar issues on 
SUSE and we have similar issues on multiple RHEL5 kernels.

I also think you might have sent the wrong patch, or I was not sure what 
  you were trying to fix.

The problem I hit with distro kernels like RHEL are the following:

1. Redefinition of is_power_of_2
2. Redefinition of shost_priv
3. Redefintion of scsi_set_resid

I do not think your patch fixed those, or I goofed up.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: [PATCH] Add compat patch for RHEL 5.2

2008-07-13 Thread Erez Zilber

On Wed, Jul 9, 2008 at 11:22 AM, Erez Zilber [EMAIL PROTECTED] wrote:
 RHEL 5.2 is based on kernel version 2.6.18, but contains code
 that wasn't included in 2.6.18 vanilla. The kernel Makefile uses
 2.6.14-19_compat.patch for it, and this creates compilation errors
 of symbol redefinition. We should have a separate compat patch for
 RHEL 5.2.

 Signed-off-by: Erez Zilber [EMAIL PROTECTED]


Mike,

Any news about this patch?

Thanks,
Erez

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[PATCH] Add compat patch for RHEL 5.2

2008-07-09 Thread Erez Zilber
RHEL 5.2 is based on kernel version 2.6.18, but contains code
that wasn't included in 2.6.18 vanilla. The kernel Makefile uses
2.6.14-19_compat.patch for it, and this creates compilation errors
of symbol redefinition. We should have a separate compat patch for
RHEL 5.2.

Signed-off-by: Erez Zilber [EMAIL PROTECTED]

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---

From a1e3bcfa281afbcca828a7a6e869efdc302511c7 Mon Sep 17 00:00:00 2001
From: Erez Zilber [EMAIL PROTECTED]
Date: Wed, 9 Jul 2008 11:10:51 +0300
Subject: [PATCH 1/1] Add compat patch for RHEL 5.2

RHEL 5.2 is based on kernel version 2.6.18, but contains code
that wasn't included in 2.6.18 vanilla. The kernel Makefile uses
2.6.14-19_compat.patch for it, and this creates compilation errors
of symbol redefinition. We should have a separate compat patch for
RHEL 5.2.

Signed-off-by: Erez Zilber [EMAIL PROTECTED]
---
 kernel/2.6.18-92.el5_compat.patch | 1168 +
 kernel/Makefile   |   27 +-
 2 files changed, 1188 insertions(+), 7 deletions(-)
 create mode 100644 kernel/2.6.18-92.el5_compat.patch

diff --git a/kernel/2.6.18-92.el5_compat.patch b/kernel/2.6.18-92.el5_compat.patch
new file mode 100644
index 000..126c956
--- /dev/null
+++ b/kernel/2.6.18-92.el5_compat.patch
@@ -0,0 +1,1168 @@
+diff --git a/iscsi_tcp.c b/iscsi_tcp.c
+index 908b541..dfd8e31 100644
+--- a/iscsi_tcp.c
 b/iscsi_tcp.c
+@@ -426,6 +426,17 @@ iscsi_segment_seek_sg(struct iscsi_segment *segment,
+ 
+ 	debug_scsi(iscsi_segment_seek_sg offset %u size %llu\n,
+ 		  offset, size);
++
++	/*
++	 * older kernels could send use_sg=0 for commands like sgio
++	 * or scsi-ml commands.
++	 */
++	if (!sg_count) {
++		iscsi_segment_init_linear(segment, (void *)sg_list + offset,
++	  size, done, hash);
++		return 0;
++	}
++
+ 	__iscsi_segment_init(segment, size, done, hash);
+ 	for_each_sg(sg_list, sg, sg_count, i) {
+ 		debug_scsi(sg %d, len %u offset %u\n, i, sg-length,
+@@ -536,7 +547,7 @@ iscsi_data_rsp(struct iscsi_conn *conn, struct iscsi_task *task)
+ 	struct iscsi_session *session = conn-session;
+ 	struct scsi_cmnd *sc = task-sc;
+ 	int datasn = be32_to_cpu(rhdr-datasn);
+-	unsigned total_in_length = scsi_in(sc)-length;
++	unsigned total_in_length = scsi_bufflen(sc);
+ 
+ 	iscsi_update_cmdsn(session, (struct iscsi_nopin*)rhdr);
+ 	if (tcp_conn-in.datalen == 0)
+@@ -568,7 +579,7 @@ iscsi_data_rsp(struct iscsi_conn *conn, struct iscsi_task *task)
+ 			if (res_count  0 
+ 			(rhdr-flags  ISCSI_FLAG_CMD_OVERFLOW ||
+ 			 res_count = total_in_length))
+-scsi_in(sc)-resid = res_count;
++scsi_set_resid(sc, res_count);
+ 			else
+ sc-result = (DID_BAD_TARGET  16) |
+ 	rhdr-cmd_status;
+@@ -679,11 +690,11 @@ iscsi_r2t_rsp(struct iscsi_conn *conn, struct iscsi_task *task)
+ 			r2t-data_length, session-max_burst);
+ 
+ 	r2t-data_offset = be32_to_cpu(rhdr-data_offset);
+-	if (r2t-data_offset + r2t-data_length  scsi_out(task-sc)-length) {
++	if (r2t-data_offset + r2t-data_length  scsi_bufflen(task-sc)) {
+ 		iscsi_conn_printk(KERN_ERR, conn,
+   invalid R2T with data len %u at offset %u 
+   and total length %d\n, r2t-data_length,
+-  r2t-data_offset, scsi_out(task-sc)-length);
++  r2t-data_offset, scsi_bufflen(task-sc));
+ 		__kfifo_put(tcp_task-r2tpool.queue, (void*)r2t,
+ 			sizeof(void*));
+ 		return ISCSI_ERR_DATALEN;
+@@ -783,7 +794,6 @@ iscsi_tcp_hdr_dissect(struct iscsi_conn *conn, struct iscsi_hdr *hdr)
+ 		if (tcp_conn-in.datalen) {
+ 			struct iscsi_tcp_task *tcp_task = task-dd_data;
+ 			struct hash_desc *rx_hash = NULL;
+-			struct scsi_data_buffer *sdb = scsi_in(task-sc);
+ 
+ 			/*
+ 			 * Setup copy of Data-In into the Scsi_Cmnd
+@@ -801,8 +811,8 @@ iscsi_tcp_hdr_dissect(struct iscsi_conn *conn, struct iscsi_hdr *hdr)
+   tcp_task-data_offset,
+   tcp_conn-in.datalen);
+ 			rc = iscsi_segment_seek_sg(tcp_conn-in.segment,
+-		   sdb-table.sgl,
+-		   sdb-table.nents,
++		   scsi_sglist(task-sc),
++		   scsi_sg_count(task-sc),
+ 		   tcp_task-data_offset,
+ 		   tcp_conn-in.datalen,
+ 		   iscsi_tcp_process_data_in,
+@@ -1369,8 +1379,8 @@ iscsi_tcp_task_init(struct iscsi_task *task)
+ 		return 0;
+ 
+ 	/* If we have immediate data, attach a payload */
+-	err = iscsi_tcp_send_data_prep(conn, scsi_out(sc)-table.sgl,
+-   scsi_out(sc)-table.nents,
++	err = iscsi_tcp_send_data_prep(conn, scsi_sglist(sc),
++   scsi_sg_count(sc),
+    0, task-imm_count);
+ 	if (err)
+ 		return err;
+@@ -1393,7 +1403,6 @@ iscsi_tcp_task_xmit(struct iscsi_task *task)
+ 	struct iscsi_conn