[DRBD-user] Compile Problem (kernel 2.6.18-mm3)

Brent Davidson brent at texascountrytitle.com
Tue Nov 7 22:07:32 CET 2006

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


Well, I found the reason behind my error.  The mm3 kernel patches 
redefine kmem_cache_destroy as void.  I patched the 
drbd_destroy_mempools function in drbd_main.c as follows.  Please let me 
know if this is sane.

void drbd_destroy_mempools(void)
{
        if (drbd_request_mempool)
                mempool_destroy(drbd_request_mempool);
        if (drbd_ee_cache)
                kmem_cache_destroy(drbd_ee_cache);
        /* Above code changed from the following function for compatibility
        /  with mm3 patches to kernel 2.6.18:
        /
        /  if (drbd_ee_cache) && kmem_cache_destroy(drbd_ee_cache))
        /       printk(KERN_ERR DEVICE_NAME
        /              ": kmem_cache_destroy(drbd_ee_cache) FAILED\n");
        */
        if (drbd_request_cache)
                kmem_cache_destroy(drbd_request_cache);

        /* Above code changed from the following function for compatability
        /  with the mm3 patches to kernel 2.6.18:
        /
        /  if (drbd_request_cache && kmem_cache_destroy(drbd_request_cache))
        /       printk(KERN_ERR DEVICE_NAME
        */

        // FIXME what can we do if we fail to destroy them?

        drbd_request_mempool = NULL;
        drbd_ee_cache        = NULL;
        drbd_request_cache   = NULL;

        return;
}


The code in the MM patches that redefines kmem_cache_destroy as void has 
this to say:

"There is very little, say, filesystem driver code can do upon failed
kmem_cache_destroy(). If it will be decided to BUG in this case, BUG
should be put in generic code, instead."


Thanks,
Brent Davidson


Brent Davidson wrote:
> I'm having a problme compiling drbd version 0.7.22 under Centos 4.4 x86_64
> using an updated kernel.  Kernel source for 2.6.18 was retrieved from
> kernel.org, mm3 patches were replied.  Local kernel version is
> 2.6.18-mm3.x86_64.smp
>
> I am getting an error in drbd_main.c.  I get the same error with source
> retrived from svn and from Tarball.
>
> Here's the output of my build attempt:
>
> [root at localhost drbd]# make clean all
> rm -rf .tmp_versions
> rm -f *.[oas] *.ko .*.cmd .*.d .*.tmp *.mod.c .*.flags .depend .kernel*
>
>     Calling toplevel makefile of kernel source tree, which I believe is in
>     KDIR=/lib/modules/2.6.18-mm3.x86_64.smp/build
>
> test -f ../scripts/adjust_drbd_config_h.sh && \
>  KDIR=/lib/modules/2.6.18-mm3.x86_64.smp/build /bin/sh
> ../scripts/adjust_drbd_config_h.sh
>
>   Using unmodified drbd_config.h
>
> make -C /lib/modules/2.6.18-mm3.x86_64.smp/build
> SUBDIRS=/root/drbd/drbd-0.7.22/drbd  modules
> make[1]: Entering directory `/usr/src/linux-2.6.18'
>   CC [M]  /root/drbd/drbd-0.7.22/drbd/drbd_sizeof_sanity_check.o
>   CC [M]  /root/drbd/drbd-0.7.22/drbd/drbd_buildtag.o
>   CC [M]  /root/drbd/drbd-0.7.22/drbd/drbd_bitmap.o
>   CC [M]  /root/drbd/drbd-0.7.22/drbd/drbd_fs.o
>   CC [M]  /root/drbd/drbd-0.7.22/drbd/drbd_proc.o
>   CC [M]  /root/drbd/drbd-0.7.22/drbd/drbd_worker.o
>   CC [M]  /root/drbd/drbd-0.7.22/drbd/drbd_receiver.o
> /root/drbd/drbd-0.7.22/drbd/drbd_receiver.c: In function `drbd_asender':
> /root/drbd/drbd-0.7.22/drbd/drbd_receiver.c:2315: warning: unused variable
> `empty'
>   CC [M]  /root/drbd/drbd-0.7.22/drbd/drbd_req.o
>   CC [M]  /root/drbd/drbd-0.7.22/drbd/drbd_actlog.o
>   CC [M]  /root/drbd/drbd-0.7.22/drbd/lru_cache.o
>   CC [M]  /root/drbd/drbd-0.7.22/drbd/drbd_main.o
> /root/drbd/drbd-0.7.22/drbd/drbd_main.c: In function `drbd_destroy_mempools':
> /root/drbd/drbd-0.7.22/drbd/drbd_main.c:1630: error: void value not
> ignored as it ought to be
> /root/drbd/drbd-0.7.22/drbd/drbd_main.c:1633: error: void value not
> ignored as it ought to be
> make[2]: *** [/root/drbd/drbd-0.7.22/drbd/drbd_main.o] Error 1
> make[1]: *** [_module_/root/drbd/drbd-0.7.22/drbd] Error 2
> make[1]: Leaving directory `/usr/src/linux-2.6.18'
> make: *** [kbuild] Error 2
> [root at localhost drbd]#
>
> Thanks,
> Brent Davidson
>
> _______________________________________________
> drbd-user mailing list
> drbd-user at lists.linbit.com
> http://lists.linbit.com/mailman/listinfo/drbd-user
>
>
>   


-- 
Brent Davidson
Texas Country Title Company
P.O. Box 663
Cameron, TX 76520
254-605-0140 ex. 21




More information about the drbd-user mailing list