LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

ipvs-0.9.8 compiling problem

To: "lvs-users@xxxxxxxxxxxxxxxxxxxxxx" <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: ipvs-0.9.8 compiling problem
From: Leonardo Balliache <leoball@xxxxxxxxxxxx>
Date: Wed, 22 May 2002 07:49:32 -0400
Hi, guys:

I got this error trying to compile ipvs-0.9.8.
My kernel is 2.4.16 in SuSE 7.1:

--------------------------- error -------------------------------------
gcc -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -DMODVERSIONS  \
-DCONFIG_IP_VS_DEBUG -g -O2 -Wall -Wstrict-prototypes \
-I/usr/src/linux/include \
-include /usr/src/linux/include/linux/modversions.h \
-c -o ip_vs_ctl.o ip_vs_ctl.c

ip_vs_ctl.c: In function `update_defense_level':
ip_vs_ctl.c:99: request for member `counter' in something not a \
structure or union
make: *** [ip_vs_ctl.o] Error 1
--------------------------- error -------------------------------------

Ok. I found some problems with patches. Using my original 2.4.16 files
I had to patch only the file net/netsyms.c with this patch:

----------------------- patch applied ----------------------------------
--- linux-2.4.5/net/netsyms.c.orig      Wed May  2 16:59:49 2001
+++ linux-2.4.5/net/netsyms.c   Sun Jun 17 22:00:23 2001
@@ -248,6 +248,7 @@
 EXPORT_SYMBOL(in_aton);
 EXPORT_SYMBOL(ip_mc_inc_group);
 EXPORT_SYMBOL(ip_mc_dec_group);
+EXPORT_SYMBOL(ip_mc_join_group);
 EXPORT_SYMBOL(ip_finish_output);
 EXPORT_SYMBOL(inet_dgram_ops);
 EXPORT_SYMBOL(ip_cmsg_recv);
----------------------- patch applied ---------------------------------

But for file kernel/ksyms.c the patch was ready in my original files;
this patch was not applied:

----------------------- patch not applied -----------------------------
--- linux-2.4.5/kernel/ksyms.c.orig     Sat Jun  2 12:16:15 2001
+++ linux-2.4.5/kernel/ksyms.c  Sun Jun 17 21:54:07 2001
@@ -127,6 +127,9 @@
 EXPORT_SYMBOL(highmem_start_page);
 EXPORT_SYMBOL(create_bounce);
 #endif
+EXPORT_SYMBOL(buffermem_pages);
+EXPORT_SYMBOL(nr_free_pages);
+EXPORT_SYMBOL(page_cache_size);

 /* filesystem internal functions */
 EXPORT_SYMBOL(def_blk_fops);
----------------------- patch not applied -----------------------------

When I checked the offending line we have:

----------------------- offending code --------------------------------
/*
 *  update_defense_level is called from timer bh and from sysctl.
 */
void update_defense_level(void)
{
        int ip_vs_amem = nr_free_pages() + atomic_read(&page_cache_size) +
                atomic_read(&buffermem_pages);
----------------------- offending code --------------------------------

The problem is in line "int ip_vs_amen ...."

Observes that problem is just with the line containing calls to
nr_free_pages(), atomic_read(&page_cache_size) and
atomic_read(&buffermem_page); values that are exported in file
kernel/ksyms.c that I didn't patch because the patch was in my
original file.

I checked function atomic_read in include/asm/atomic.h and it really
operates over a structure containing a member called "counter":

-------------------- function atomic_read -----------------------------
typedef struct { volatile int counter; } atomic_t;

#define atomic_read(v)          ((v)->counter)
-------------------- function atomic_read -----------------------------

I really don't understand the error message of the compiler.

Any help?





<Prev in Thread] Current Thread [Next in Thread>