[ENBD] enbd_ioctl 2.6.9 kernel fails to modprobe enbd - seg fault

scunacc scunacc at yahoo.com
Thu Mar 2 11:31:59 MST 2006


Dear Peter et al.,

Here is a "raw" compile of enbd-2.4.33pre.tgz

-------------------------------
make config all
mkdir -p /tmp/enbd
cp nbd/configure /tmp/enbd/configure && chmod +x /tmp/enbd/configure
export CONFIG_SITE=/home/sysadmin/net_disk/nbd-2.4.33/conf/config.Linux;
\
cd /tmp/enbd;  ./configure
--srcdir=/home/sysadmin/net_disk/nbd-2.4.33/nbd  \

--with-kernel-srcdir=/lib/modules/2.6.9-cm46customVM/build; \
#make VPATH=/home/sysadmin/net_disk/nbd-2.4.33/nbd \
        #        CFLAGS="-D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1
-D_GNU_SOURCE=1 -D_XOPEN_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Wall -Winline
-O2 \
        #              -I/tmp/enbd \
        #
-I/home/sysadmin/net_disk/nbd-2.4.33/kernel/linux-2.6.x/include \
        #              -D__SMP__ -DCONFIG_X86_LOCAL_APIC -DUSING_SSL=1
-DDEBUG=0" \
        #        EXTRA_LIBS="  -lssl -lcrypto " \
        #        config
creating cache ./config.cache
checking for gcc... gcc
checking whether the C compiler (gcc -D_LARGEFILE64_SOURCE=1
-D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1 -D_XOPEN_SOURCE=1
-D_FILE_OFFSET_BITS=64 -Wall -Winline -O2
-I/lib/modules/2.6.9-cm46customVM/build/include ) works... yes
checking whether the C compiler (gcc -D_LARGEFILE64_SOURCE=1
-D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1 -D_XOPEN_SOURCE=1
-D_FILE_OFFSET_BITS=64 -Wall -Winline -O2
-I/lib/modules/2.6.9-cm46customVM/build/include ) is a cross-compiler...
no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking whether warnings should be enabled... yes
checking for install... /usr/bin/install
checking whether byte ordering is bigendian... no
checking for inline... inline
checking for working const... yes
checking size of unsigned char... 1
checking size of unsigned short int... 2
checking size of unsigned int... 4
checking size of unsigned long int... 4
checking size of unsigned long long int... 8
checking size of char... 1
checking size of short int... 2
checking size of int... 4
checking size of long int... 4
checking size of long long int... 8
checking for llseek... yes
checking for lseek64... yes
checking for if_nameindex... yes
checking for bdflush... yes
checking for mlockall... yes
checking for daemon... yes
checking for strsep... yes
checking for strtok_r... yes
checking for timeradd... no
checking for atomic_t... yes
checking for atomic_set... yes
checking for atomic_dec_and_test... yes
checking for atomic_inc... yes
checking for strgsub in -lpub... no
checking for hosts_access in -lwrap... yes
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for size_t... yes
checking for socklen_t... yes
checking whether client should be built... yes
checking where your init scripts are kept... /etc/init.d
checking where pidfiles and state files go... below /var
checking where helper scripts go... ${exec_prefix}/sbin
checking where configuration files go... /etc
checking where man pages go... ${prefix}/man
checking where misc documents go... ${prefix}/share/doc
checking where daemons go... ${exec_prefix}/sbin
updating cache ./config.cache
creating ./config.status
creating Makefile
creating config.h
make -C /tmp/enbd VPATH=/home/sysadmin/net_disk/nbd-2.4.33/nbd \
                            CFLAGS="-D_LARGEFILE64_SOURCE=1
-D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1 -D_XOPEN_SOURCE=1
-D_FILE_OFFSET_BITS=64 -Wall -Winline -O2 \
                                  -I/tmp/enbd \

-I/home/sysadmin/net_disk/nbd-2.4.33/kernel/linux-2.6.x/include \

-I/lib/modules/2.6.9-cm46customVM/build/include \
                                    -D__SMP__ -DCONFIG_X86_LOCAL_APIC
-DUSING_SSL=1 \
                                  -DDEBUG=0" \
                            EXTRA_LIBS=" \
                                         -lssl -lcrypto "
make[1]: Entering directory `/tmp/enbd'
gcc -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1
-D_XOPEN_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Wall -Winline -O2  -I/tmp/enbd
-I/home/sysadmin/net_disk/nbd-2.4.33/kernel/linux-2.6.x/include
-I/lib/modules/2.6.9-cm46customVM/build/include  -D__SMP__
-DCONFIG_X86_LOCAL_APIC -DUSING_SSL=1  -DDEBUG=0 -o enbd-server.o
-c /home/sysadmin/net_disk/nbd-2.4.33/nbd/enbd-server.c
/home/sysadmin/net_disk/nbd-2.4.33/nbd/enbd-server.c: In function
‘connectme’:
/home/sysadmin/net_disk/nbd-2.4.33/nbd/enbd-server.c:1153: warning:
pointer targets in passing argument 3 of ‘accept’ differ in
signedness
/home/sysadmin/net_disk/nbd-2.4.33/nbd/enbd-server.c: In function
‘slavesighandler’:
/home/sysadmin/net_disk/nbd-2.4.33/nbd/enbd-server.c:1234: error:
invalid storage class for function ‘nullsigchldhandler’
/home/sysadmin/net_disk/nbd-2.4.33/nbd/enbd-server.c:1263: warning:
implicit declaration of function ‘nullsigchldhandler’
/home/sysadmin/net_disk/nbd-2.4.33/nbd/enbd-server.c: At top level:
/home/sysadmin/net_disk/nbd-2.4.33/nbd/enbd-server.c:3332: warning:
conflicting types for ‘nullsigchldhandler’
/home/sysadmin/net_disk/nbd-2.4.33/nbd/enbd-server.c:3332: error: static
declaration of ‘nullsigchldhandler’ follows non-static declaration
/home/sysadmin/net_disk/nbd-2.4.33/nbd/enbd-server.c:1263: error:
previous implicit declaration of ‘nullsigchldhandler’ was here
make[1]: *** [enbd-server.o] Error 1
make[1]: Leaving directory `/tmp/enbd'
make: *** [utils] Error 2


-------------------------------
Now, if I "fix" that by moving the declaration at 1234 just above
outside of the function it's in, it continues, and compiles up to the
following:....

-------------------------------
.......

gcc -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1
-D_XOPEN_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Wall -Winline -O2  -I/tmp/enbd
-I/home/sysadmin/net_disk/nbd-2.4.33/kernel/linux-2.6.x/include
-I/lib/modules/2.6.9-cm46customVM/build/include  -D__SMP__
-DCONFIG_X86_LOCAL_APIC -DUSING_SSL=1  -DDEBUG=0 -o ioctl.o
-c /home/sysadmin/net_disk/nbd-2.4.33/nbd/ioctl.c
In file included
from /lib/modules/2.6.9-cm46customVM/build/include/asm/byteorder.h:57,

from /lib/modules/2.6.9-cm46customVM/build/include/linux/cdrom.h:14,
                 from /home/sysadmin/net_disk/nbd-2.4.33/nbd/ioctl.c:63:
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:43: error: syntax error before ‘__cpu_to_le64p’
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:44: warning: return type defaults to ‘int’
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h: In function ‘__cpu_to_le64p’:
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:45: error: ‘__le64’ undeclared (first use in this function)
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:45: error: (Each undeclared identifier is reported only once
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:45: error: for each function it appears in.)
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h: At top level:
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:47: warning: type defaults to ‘int’ in declaration of ‘__le64’
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:47: error: syntax error before ‘*’ token
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h: In function ‘__le64_to_cpup’:
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:49: error: ‘p’ undeclared (first use in this function)
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h: At top level:
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:51: error: syntax error before ‘__cpu_to_le32p’
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:52: warning: return type defaults to ‘int’
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h: In function ‘__cpu_to_le32p’:
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:53: error: ‘__le32’ undeclared (first use in this function)
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h: At top level:
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:55: warning: type defaults to ‘int’ in declaration of ‘__le32’
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:55: error: syntax error before ‘*’ token
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h: In function ‘__le32_to_cpup’:
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:57: error: ‘p’ undeclared (first use in this function)
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h: At top level:
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:59: error: syntax error before ‘__cpu_to_le16p’
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:60: warning: return type defaults to ‘int’
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h: In function ‘__cpu_to_le16p’:
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:61: error: ‘__le16’ undeclared (first use in this function)
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h: At top level:
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:63: warning: type defaults to ‘int’ in declaration of ‘__le16’
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:63: error: syntax error before ‘*’ token
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h: In function ‘__le16_to_cpup’:
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:65: error: ‘p’ undeclared (first use in this function)
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h: At top level:
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:67: error: syntax error before ‘__cpu_to_be64p’
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:68: warning: return type defaults to ‘int’
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h: In function ‘__cpu_to_be64p’:
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:69: error: ‘__be64’ undeclared (first use in this function)
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:69: error: syntax error before ‘__swab64p’
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h: At top level:
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:71: warning: type defaults to ‘int’ in declaration of ‘__be64’
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:71: error: syntax error before ‘*’ token
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h: In function ‘__be64_to_cpup’:
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:73: error: ‘p’ undeclared (first use in this function)
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h: At top level:
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:75: error: syntax error before ‘__cpu_to_be32p’
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:76: warning: return type defaults to ‘int’
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h: In function ‘__cpu_to_be32p’:
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:77: error: ‘__be32’ undeclared (first use in this function)
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:77: error: syntax error before ‘__swab32p’
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h: At top level:
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:79: warning: type defaults to ‘int’ in declaration of ‘__be32’
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:79: error: syntax error before ‘*’ token
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h: In function ‘__be32_to_cpup’:
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:81: error: ‘p’ undeclared (first use in this function)
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h: At top level:
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:83: error: syntax error before ‘__cpu_to_be16p’
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:84: warning: return type defaults to ‘int’
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h: In function ‘__cpu_to_be16p’:
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:85: error: ‘__be16’ undeclared (first use in this function)
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:85: error: syntax error before ‘__swab16p’
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h: At top level:
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:87: warning: type defaults to ‘int’ in declaration of ‘__be16’
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:87: error: syntax error before ‘*’ token
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h: In function ‘__be16_to_cpup’:
/lib/modules/2.6.9-cm46customVM/build/include/linux/byteorder/little_endian.h:89: error: ‘p’ undeclared (first use in this function)
make[1]: *** [ioctl.o] Error 1
make[1]: Leaving directory `/tmp/enbd'
make: *** [utils] Error 2


-------------------------------

If I again "fix" that by adding the following lines

(from http://lists.community.tummy.com/pipermail/enbd/2005/004023.html -
one example)

... just before 

#include <linux/cdrom.h>

it works up to here:

-------------------------------

........

  gcc -I/home/sysadmin/net_disk/nbd-2.4.33/kernel/linux-2.6.x/include
-Wp,-MD,/tmp/enbd/linux-2.6.x/drivers/block/enbd/.enbd_base.o.d
-nostdinc -iwithprefix include -D__KERNEL__ -Iinclude  -D__KERNEL__
-Iinclude  -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing
-fno-common -pipe -msoft-float     -Iinclude/asm-i386/mach-default -O2
-fomit-frame-pointer -Wdeclaration-after-statement -D__SMP__
-DCONFIG_X86_LOCAL_APIC -DUSING_SSL=1  -DMODULE
-I"/home/sysadmin/net_disk/nbd-2.4.33/kernel/linux-2.6.x/include"
-DKBUILD_BASENAME=enbd_base -DKBUILD_MODNAME=enbd -c
-o /tmp/enbd/linux-2.6.x/drivers/block/enbd/.tmp_enbd_base.o /tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c
In file included
from /tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c:295:
/home/sysadmin/net_disk/nbd-2.4.33/kernel/linux-2.6.x/include/linux/enbd.h: In function ‘local_nbd_end_request’:
/home/sysadmin/net_disk/nbd-2.4.33/kernel/linux-2.6.x/include/linux/enbd.h:443: error: invalid storage class for function ‘rq_type’
/home/sysadmin/net_disk/nbd-2.4.33/kernel/linux-2.6.x/include/linux/enbd.h:444: warning: implicit declaration of function ‘rq_type’
/home/sysadmin/net_disk/nbd-2.4.33/kernel/linux-2.6.x/include/linux/enbd.h: In function ‘enbd_end_request’:
/home/sysadmin/net_disk/nbd-2.4.33/kernel/linux-2.6.x/include/linux/enbd.h:485: error: invalid storage class for function ‘rq_set_seqno’
/home/sysadmin/net_disk/nbd-2.4.33/kernel/linux-2.6.x/include/linux/enbd.h:487: warning: implicit declaration of function ‘rq_set_seqno’
/home/sysadmin/net_disk/nbd-2.4.33/kernel/linux-2.6.x/include/linux/enbd.h: In function ‘enbd_end_request_lock’:
/home/sysadmin/net_disk/nbd-2.4.33/kernel/linux-2.6.x/include/linux/enbd.h:500: error: invalid storage class for function ‘rq_set_seqno’
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c: At top level:
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c:495: error: static
declaration of ‘rq_type’ follows non-static declaration
/home/sysadmin/net_disk/nbd-2.4.33/kernel/linux-2.6.x/include/linux/enbd.h:444: error: previous implicit declaration of ‘rq_type’ was here
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c:627: warning:
conflicting types for ‘rq_set_seqno’
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c:627: error: static
declaration of ‘rq_set_seqno’ follows non-static declaration
/home/sysadmin/net_disk/nbd-2.4.33/kernel/linux-2.6.x/include/linux/enbd.h:487: error: previous implicit declaration of ‘rq_set_seqno’ was here
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c: In function
‘enbd_get_req’:
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c:1878: error:
invalid storage class for function ‘enbd_clr_sock’
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c:1924: warning:
implicit declaration of function ‘enbd_clr_sock’
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c: At top level:
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c:2628: error: static
declaration of ‘enbd_clr_sock’ follows non-static declaration
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c:1924: error:
previous implicit declaration of ‘enbd_clr_sock’ was here
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c: In function
‘enbd_clr_sock’:
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c:2635: error:
invalid storage class for function ‘enbd_soft_reset’
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c:2680: warning:
implicit declaration of function ‘enbd_soft_reset’
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c: At top level:
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c:2859: warning:
conflicting types for built-in function ‘log2’
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c:3284: error: static
declaration of ‘enbd_soft_reset’ follows non-static declaration
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c:2680: error:
previous implicit declaration of ‘enbd_soft_reset’ was here
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c: In function
‘enbd_ioctl’:
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c:4423: warning:
pointer targets in passing argument 1 of
‘remote_ioctl->convert_inplace’ differ in signedness
make[2]: *** [/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.o]
Error 1
make[1]: *** [/tmp/enbd/linux-2.6.x/drivers/block/enbd] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.9-cm46'
*************************************
* please apply kernel patch instead *
*************************************


-------------------------------

Looking at that and noticing that these are again inline declaration
issues, I "fixed" those again (by moving outside the functions)

and it works up to here:


-------------------------------

  gcc -I/home/sysadmin/net_disk/nbd-2.4.33/kernel/linux-2.6.x/include
-Wp,-MD,/tmp/enbd/linux-2.6.x/drivers/block/enbd/.enbd_base.o.d
-nostdinc -iwithprefix include -D__KERNEL__ -Iinclude  -D__KERNEL__
-Iinclude  -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing
-fno-common -pipe -msoft-float     -Iinclude/asm-i386/mach-default -O2
-fomit-frame-pointer -Wdeclaration-after-statement -D__SMP__
-DCONFIG_X86_LOCAL_APIC -DUSING_SSL=1  -DMODULE
-I"/home/sysadmin/net_disk/nbd-2.4.33/kernel/linux-2.6.x/include"
-DKBUILD_BASENAME=enbd_base -DKBUILD_MODNAME=enbd -c
-o /tmp/enbd/linux-2.6.x/drivers/block/enbd/.tmp_enbd_base.o /tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c: In function
‘enbd_get_req’:
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c:1878: error:
invalid storage class for function ‘enbd_clr_sock’
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c:1924: warning:
implicit declaration of function ‘enbd_clr_sock’
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c: At top level:
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c:2628: error: static
declaration of ‘enbd_clr_sock’ follows non-static declaration
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c:1924: error:
previous implicit declaration of ‘enbd_clr_sock’ was here
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c: In function
‘enbd_clr_sock’:
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c:2635: error:
invalid storage class for function ‘enbd_soft_reset’
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c:2680: warning:
implicit declaration of function ‘enbd_soft_reset’
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c: At top level:
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c:2859: warning:
conflicting types for built-in function ‘log2’
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c:3284: error: static
declaration of ‘enbd_soft_reset’ follows non-static declaration
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c:2680: error:
previous implicit declaration of ‘enbd_soft_reset’ was here
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c: In function
‘enbd_ioctl’:
/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.c:4423: warning:
pointer targets in passing argument 1 of
‘remote_ioctl->convert_inplace’ differ in signedness
make[2]: *** [/tmp/enbd/linux-2.6.x/drivers/block/enbd/enbd_base.o]
Error 1
make[1]: *** [/tmp/enbd/linux-2.6.x/drivers/block/enbd] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.9-cm46'
*************************************
* please apply kernel patch instead *
*************************************


-------------------------------

One more time with the inlining thing in endb_base.c and it clean
compiles and installs.

But, it then gives the kernel errors when it's modprobed that I sent by
previous email... :-(

--------------------------------

Here's a diff -r of what I did to get to that point:

--------------------------------

diff -r nbd-2.4.33  nbd-2.4.33.mine 

diff -r nbd-2.4.33/kernel/linux-2.6.x/drivers/block/enbd/enbd_base.c
nbd-2.4.33.mine/kernel/linux-2.6.x/drivers/block/enbd/enbd_base.c
1789a1790
>               static int enbd_clr_sock (struct enbd_slot *slot); //
forward decl
1878d1878
<               static int enbd_clr_sock (struct enbd_slot *slot); //
forward decl
2616a2617
>       static int enbd_soft_reset (struct enbd_device*);
2635d2635
<       static int enbd_soft_reset (struct enbd_device*);
diff -r nbd-2.4.33/kernel/linux-2.6.x/include/linux/enbd.h
nbd-2.4.33.mine/kernel/linux-2.6.x/include/linux/enbd.h
439a440
>      static inline int rq_type(struct request *);
443d443
<      static inline int rq_type(struct request *);
479a480
>     static void rq_set_seqno(struct request *, unsigned long);
485d485
<     static void rq_set_seqno(struct request *, unsigned long);
494a495
>     static void rq_set_seqno(struct request *, unsigned long);
500d500
<     static void rq_set_seqno(struct request *, unsigned long);
diff -r nbd-2.4.33/Makefile nbd-2.4.33.mine/Makefile
20c20
< USING_SSL   := 0
---
> USING_SSL   := 1
24c24
< BUILD       := /tmp
---
> BUILD       := /tmp/enbd
26c26
< SMP         := 0
---
> SMP         := 1
diff -r nbd-2.4.33/nbd/enbd-server.c nbd-2.4.33.mine/nbd/enbd-server.c
1233d1232
<   static void slavesighandler(int n) {
1234a1234
>   static void slavesighandler(int n) {
diff -r nbd-2.4.33/nbd/ioctl.c nbd-2.4.33.mine/nbd/ioctl.c
62a63,79
> #ifdef __KERNEL_STRICT_NAMES
> 
> #ifdef __CHECKER__
> #define __bitwise __attribute__((bitwise))
> #else
> #define __bitwise
> #endif
> 
> typedef __u16 __bitwise __le16;
> typedef __u16 __bitwise __be16;
> typedef __u32 __bitwise __le32;
> typedef __u32 __bitwise __be32;
> typedef __u64 __bitwise __le64;
> typedef __u64 __bitwise __be64;
> 
> #endif //__KERNEL_STRICT_NAMES
> 

--------------------------------


Hope that helps after a fashion....


Kind regards

Derek.



More information about the ENBD mailing list