On Tue, Feb 2, 2010 at 6:28 AM, Mike Christie <micha...@cs.wisc.edu> wrote:
> On 02/01/2010 01:45 PM, Erez Zilber wrote:
>>
>> On Mon, Feb 1, 2010 at 9:29 PM, Mike Christie<micha...@cs.wisc.edu>
>>  wrote:
>>>
>>> On 02/01/2010 12:42 AM, Erez Zilber wrote:
>>>>
>>>> On Sun, Jan 31, 2010 at 8:24 PM, Rakesh Ranjan<rak...@chelsio.com>
>>>>  wrote:
>>>>>
>>>>> On 01/31/2010 08:04 PM, Erez Zilber wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> When I build open-iscsi on CentOS 5.4, I get the following errors:
>>>>>>
>>>>>> In file included from
>>>>>>
>>>>>>
>>>>>>
>>>>>> /home1/erez.zilber/work/open-source/open-iscsi/kernel/scsi_transport_iscsi.h:30,
>>>>>>                  from
>>>>>>
>>>>>>
>>>>>>
>>>>>> /home1/erez.zilber/work/open-source/open-iscsi/kernel/scsi_transport_iscsi.c:30:
>>>>>>
>>>>>>
>>>>>>
>>>>>> /home1/erez.zilber/work/open-source/open-iscsi/kernel/open_iscsi_compat.h:154:
>>>>>> error: static declaration of ‘kernel_getsockname’ follows non-static
>>>>>> declaration
>>>>>> include/linux/net.h:221: error: previous declaration of
>>>>>> ‘kernel_getsockname’ was here
>>>>>>
>>>>>>
>>>>>>
>>>>>> /home1/erez.zilber/work/open-source/open-iscsi/kernel/open_iscsi_compat.h:160:
>>>>>> error: static declaration of ‘kernel_getpeername’ follows non-static
>>>>>> declaration
>>>>>> include/linux/net.h:223: error: previous declaration of
>>>>>> ‘kernel_getpeername’ was here
>>>>>>
>>>>>> This is probably because of the following code in
>>>>>> 2.6.14-23_compat.patch:
>>>>>>
>>>>>> +#ifdef RHEL_RELEASE_CODE
>>>>>> +#if (RHEL_RELEASE_CODE<      RHEL_RELEASE_VERSION(5, 4))
>>>>>> +#define RHELC1 1
>>>>>> +#endif
>>>>>> +#endif
>>>>>>
>>>>>> and
>>>>>>
>>>>>> +#if (LINUX_VERSION_CODE<      KERNEL_VERSION(2,6,19)) \
>>>>>> +&&      !(defined RHELC1)
>>>>>> +static inline int kernel_getsockname(struct socket *sock, struct
>>>>>> sockaddr *addr,
>>>>>> +                       int *addrlen)
>>>>>> +{
>>>>>> +       return sock->ops->getname(sock, addr, addrlen, 0);
>>>>>> +}
>>>>>> +
>>>>>> +static inline int kernel_getpeername(struct socket *sock, struct
>>>>>> sockaddr *addr,
>>>>>> +                       int *addrlen)
>>>>>> +{
>>>>>> +       return sock->ops->getname(sock, addr, addrlen, 1);
>>>>>> +}
>>>>>> +#endif
>>>>>>
>>>>>> What does RHELC1 mean? What does it have to do with versions older
>>>>>> than
>>>>>> 5.4?
>>>>>
>>>>> Hi Erez,
>>>>>
>>>>> RHELC1 is for RHEL5.{1,3}, IIRC it defines some of the missing symbols
>>>>> from
>>>>> RHEL5.{1,3} and apart from that it also provides some build support for
>>>>> older SLES. About the above error's it seems we need to put a check for
>>>>> CentOS versions.
>>>>>
>>>>> Regards
>>>>> Rakesh Ranjan
>>>>>
>>>>
>>>> Hi Rakesh,
>>>>
>>>> CentOS&    RHEL have the same kernels. What I'm asking is: what is the
>>>> difference between RHEL 5.3 and 5.4 (or: what is the difference
>>>> between CentOS 5.3 and 5.4). It looks like getsockname&    getpeername
>>>> exist in both 5.3&    5.4. Do you think that 5.4 should be handled
>>>> differently?
>>>>
>>>
>>> I do not think so. I think what happened is that only 5.3 was out when
>>> Rakesh made the patch, so it was just a dumb case of where I did not
>>> update
>>> the patch when 5.4 came up.
>>>
>>
>> So, it's a trivial patch, isn't it? Do you want me to send a patch or
>> will you add it yourself? I can send a patch tomorrow.
>>
>
> Go ahead and send it. I am almost done with the patch to fix up the other
> problem you posted about.
>

I've attached 2 versions. One fixes only the < 5.5 case and the other
one handles all RHEL versions that are <6.0. I prefer the 2nd one
(assuming that there will be no API breakage until RHEL 6.0).

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

From 3c0e2cfabd2828976118d183a1914d5597317443 Mon Sep 17 00:00:00 2001
From: Erez Zilber <erezzi.l...@gmail.com>
Date: Tue, 2 Feb 2010 10:48:45 +0200
Subject: [PATCH] Fix 2.6.14-23_compat.patch to support also RHEL 5.4

Setting RHELC1 = 1 is relevant also for RHEL 5.4.

Signed-off-by: Erez Zilber <erezzi.l...@gmail.com>
---
 kernel/2.6.14-23_compat.patch |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/2.6.14-23_compat.patch b/kernel/2.6.14-23_compat.patch
index db0ef10..93973dd 100644
--- a/kernel/2.6.14-23_compat.patch
+++ b/kernel/2.6.14-23_compat.patch
@@ -405,7 +405,7 @@ index 0000000..5c98fef
 +#endif
 +
 +#ifdef RHEL_RELEASE_CODE
-+#if (RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5, 4))
++#if (RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5, 5))
 +#define RHELC1	1
 +#endif
 +#endif
-- 
1.5.5.6

From 64a144faf5075037750833a8afc9f22daa445db9 Mon Sep 17 00:00:00 2001
From: Erez Zilber <erezzi.l...@gmail.com>
Date: Tue, 2 Feb 2010 10:42:18 +0200
Subject: [PATCH] Fix 2.6.14-23_compat.patch to support all RHEL 5.X versions

Assuming that future RHEL 5.X releases won't break the API,
the compat patch should just check if the RHEL version is
lower than 6.0. RHEL versions lower than 5.0 (e.g. RHEL 4.X)
are irrelevant because this patch is for kernels >= 2.6.14.

Signed-off-by: Erez Zilber <erezzi.l...@gmail.com>
---
 kernel/2.6.14-23_compat.patch |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/2.6.14-23_compat.patch b/kernel/2.6.14-23_compat.patch
index db0ef10..a16e572 100644
--- a/kernel/2.6.14-23_compat.patch
+++ b/kernel/2.6.14-23_compat.patch
@@ -405,7 +405,7 @@ index 0000000..5c98fef
 +#endif
 +
 +#ifdef RHEL_RELEASE_CODE
-+#if (RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5, 4))
++#if (RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(6, 0))
 +#define RHELC1	1
 +#endif
 +#endif
-- 
1.5.5.6

Reply via email to