Bug 8829

Summary: patching the kernel with web100 hides the cn_init and cn_fini preventing drbd from working
Product: Other Reporter: Maurice Volaski (mvolaski)
Component: OtherAssignee: other_other
Status: REJECTED INVALID    
Severity: normal CC: bunk
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.22 Subsystem:
Regression: --- Bisected commit-id:

Description Maurice Volaski 2007-07-30 11:27:49 UTC
There is something funky going on but I don't even know where to place the blame. And involves two independent patches/modules that are not part of mainline kernel, but my best guess is it has something to do with how symbols get resolved in the kernel by depmod, so I am posting it here.

First, setup a fresh kernel with CONFIG_CONNECTOR=y.

There is an independent patch to the kernel called web100, available from http://www.web100.org/.

This consists of a series of patches to the tcp files and though they have no apparent relationship to CONFIG_CONNECTOR, once they are installed, depmod, I am guessing, will not longer see the symbols associated with them, specifically cn_fini and cn_init.

Second, patch the kernel with the web100 patch at http://www.web100.org/download/kernel/2.5.16/web100-2.5.16-200707191523.tar.gz. On the fresh kernel, this should patch cleanly and as you can see below, it affects no files associated with CONFIG_CONNECTOR:
patching file fs/proc/Makefile
patching file fs/proc/root.c
patching file fs/proc/web100.c
patching file include/linux/netlink.h
patching file include/linux/proc_fs.h
patching file include/linux/sysctl.h
patching file include/linux/tcp.h
patching file include/net/tcp.h
patching file include/net/web100.h
patching file include/net/web100_stats.h
patching file net/ipv4/Kconfig
patching file net/ipv4/Makefile
patching file net/ipv4/sysctl_net_ipv4.c
patching file net/ipv4/tcp.c
patching file net/ipv4/tcp_cong.c
patching file net/ipv4/tcp_input.c
patching file net/ipv4/tcp_ipv4.c
patching file net/ipv4/tcp_minisocks.c
patching file net/ipv4/tcp_output.c
patching file net/ipv4/tcp_timer.c
patching file net/ipv4/web100_stats.c
patching file net/ipv6/tcp_ipv6.c


drbd is a network block device that requires CONFIG_CONNECTOR. It is available from http://oss.linbit.com/drbd/ and any recent version should suffice. I used 8.0.3.

Third, make and make install drbd. You should then see two complaint messages after depmod runs,

WARNING: ./drbd.ko needs unknown symbol cn_fini
WARNING: ./drbd.ko needs unknown symbol cn_init

These messages would not show up if web100 was not installed, but web100 is not doing anything in its patching that could possibly cause this behavior. So it seems that there might be some hidden bug in depmod that only shows up when this set of patches is installed. 

I have reproduced this in earlier kernels using the same depmod, although in the past, I didn't have this problem. That seems to further suggest that version of depmod I'm using, Gentoo module-init-tools-3.2.2-r3, is the culprit. (Even though it's a Gentoo release, I still think the source of the problem is most likely with depmod.)
Comment 1 Maurice Volaski 2007-08-01 13:28:51 UTC
I just retested this and I think I found further evidence depmod is at fault. Merely patching the kernel files in /usr/src/linux with web100 is enough to cause this error on make installing drbd. Reverse the patch and then make install drbd works fine. The kernel doesn't even need to be recompiled.
Comment 2 Adrian Bunk 2007-08-01 15:42:29 UTC
depmod is not at all at fault.

If you look at the source code of the two patches you apply it's obvious why applying both to one kernel does not work.