[SRU] module drbd8 update kernel from 2.6.32-16 to 2.6.32-20

Bug #562832 reported by Gaëtan Ferez
30
This bug affects 4 people
Affects Status Importance Assigned to Milestone
dkms (Ubuntu)
Won't Fix
Medium
Unassigned
Lucid
Won't Fix
Undecided
Unassigned
drbd8 (Ubuntu)
Fix Released
Medium
Unassigned
Lucid
Fix Released
Undecided
Unassigned

Bug Description

I have installed drbd8-utils on Ubuntu Lucid 10.04 beta 1.
 After updating the kernel to 2.6.32-20-generic, the module drbd can't be loaded.
I have an error during the load :

FATAL: Error inserting drbd (/lib/modules/2.6.32-20-generic/updates/dkms/drbd.ko): Invalid module format

Dmesg :

[ 190.376039] drbd: disagrees about version of symbol module_layout

When i update the kernel, i can just see in the log :

ubuntu-laptop dkms_autoinstaller: drbd8 (8.3.7): Installing module on kernel 2.6.32-20-generic.

I think that the problem results from dkms program

ProblemType: Bug
Architecture: i386
Date: Wed Apr 14 09:47:41 2010
DistroRelease: Ubuntu 10.04
InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Beta i386 (20100318)
Package: drbd8-utils 2:8.3.7-1ubuntu1
ProcEnviron:
 LANG=fr_FR.utf8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.32-20.30-generic 2.6.32.11+drm33.2
SourcePackage: drbd8
Uname: Linux 2.6.32-20-generic i686

Revision history for this message
Gaëtan Ferez (gferez) wrote :
Revision history for this message
Scott Moser (smoser) wrote :

Can you verify if this is still present? I just did:

$ sudo apt-get install drbd8-utils linux-headers-generic
that succeeded in building drbd.ko

Then:
$ sudo modprobe drbd

I'm currently booted into -19-generic and have -21-generic installed.

It seems strange that you got the module built but it wont load, rather than failing to build.

Changed in drbd8 (Ubuntu):
importance: Undecided → Medium
status: New → Incomplete
Revision history for this message
Gaëtan Ferez (gferez) wrote :

If i did apt-get install linux-headers-2.6.32-20-generic linux-image-2.6.32-20-generic from a version with the 2.6.32-16 kernel and the drbd module, I have the same error :

Invalid module format when i restarted on the last kernel

The syslog tail the same thing, just :
drbd8 (8.3.7): Installing module on kernel 2.6.32-20-generic.

The status of dkms :
# dkms status
drbd8, 8.3.7, 2.6.32-16-generic, i686: installed
drbd8, 8.3.7, 2.6.32-20-generic, i686: installed

Revision history for this message
Scott Moser (smoser) wrote :

ah. so it would seem that dkms is not finding the correct version of headers if there are multiple present.
Does that sound right?

Scott Moser (smoser)
Changed in drbd8 (Ubuntu):
status: Incomplete → New
Revision history for this message
Gaëtan Ferez (gferez) wrote :

No, i don't think
Because, when i did this commands :

# dkms remove -m drbd8 -v 8.3.7 -a 2.6.32-20-generic
# dkms build -m drbd8 -v 8.3.7 -a 2.6.32-20-generic
# dkms install -m drbd8 -v 8.3.7 -a 2.6.32-20-generic

Without any other command, the module is successfully build and modprobe don't return any error.
drbd8 run perfectly

Revision history for this message
Ante Karamatić (ivoks) wrote : Re: [Bug 562832] Re: module drbd8 update kernel from 2.6.32-16 to 2.6.32-20

On 16.04.2010 21:38, Gaëtan Ferez wrote:
> No, i don't think
> Because, when i did this commands :
>
> # dkms remove -m drbd8 -v 8.3.7 -a 2.6.32-20-generic
> # dkms build -m drbd8 -v 8.3.7 -a 2.6.32-20-generic
> # dkms install -m drbd8 -v 8.3.7 -a 2.6.32-20-generic
>
> Without any other command, the module is successfully build and modprobe don't return any error.
> drbd8 run perfectly

So, when you tell dkms explicitly which headers to use and what module
version to build, everything is fine. If you leave autodetection to
dkms, it fails.

Hm... This sounds like dkms issue.

Revision history for this message
Ante Karamatić (ivoks) wrote : Re: [Ubuntu-ha] [Bug 562832] Re: module drbd8 update kernel from 2.6.32-16 to 2.6.32-20

On 18.04.2010 21:15, Ante Karamatić wrote:

> Hm... This sounds like dkms issue.

I managed to reproduce the issue. I've booted 2.6.32-16 kernel and
installed drbd8-utils. drbd module loaded fine and worked. But when
rebooted in 2.6.32-21, it failed with the same symptoms:

drbd: disagrees about version of symbol module_layout

Purging and reinstalling drbd8-utils (and thus rebuilding drbd module),
drbd module was loadable and usable in 2.6.32-21.

So, I'm quite sure this is dkms issue with headers...

Changed in dkms (Ubuntu):
importance: Undecided → Medium
Changed in drbd8 (Ubuntu):
status: New → Incomplete
Revision history for this message
Gaëtan Ferez (gferez) wrote : Re: module drbd8 update kernel from 2.6.32-16 to 2.6.32-20

Hi,

I search a reason of this problem, and I found something, when dkms launch the drbd module compilation with make command, the Makefile of drbd take the kernel source dir of 2.6.32-16-generic :

DKMS make.log for drbd8-8.3.7 for kernel 2.6.32-21-generic (i686)
lundi 19 avril 2010, 11:04:01 (UTC+0200)
make: entrant dans le répertoire « /var/lib/dkms/drbd8/8.3.7/build/drbd »

    Calling toplevel makefile of kernel source tree, which I believe is in
    KDIR=/lib/modules/2.6.32-16-generic/build

test -f ../scripts/adjust_drbd_config_h.sh && \
  KDIR=/lib/modules/2.6.32-16-generic/build O= /bin/bash ../scripts/adjust_drbd_config_h.sh

but dkms launch this command :
make KERNELRELEASE=2.6.32-21-generic -C drbd KERNELDIR=/lib/modules/2.6.32-21-generic/build

I looked in the Makefile of drbd module.We have this line with research the KDIR :

  # for some reason some of the commands below only work correctly in bash,
  # and not in e.g. dash. I'm too lazy to fix it to be compatible.
  SHELL=/bin/bash

  DRBDSRC := $(shell pwd)
  export DRBDSRC

  # to be overridden on command line:
  PREFIX := /
  ifneq ($(wildcard ../build-for-uml),)
    #### for Philipp's convenience :)
    ARCH_UM := "ARCH=um"
    KDIR := /usr/src/linux-um
  else
    ifeq ($(wildcard /lib/modules/$(shell uname -r)/source),)
      KDIR := /lib/modules/$(shell uname -r)/build
    else
      KDIR := /lib/modules/$(shell uname -r)/source
      ifneq ("$(origin KDIR)", "command line")
        ifneq ($(wildcard /lib/modules/$(shell uname -r)/build),)
          O := /lib/modules/$(shell uname -r)/build
        endif
      endif
    endif
  endif

Revision history for this message
Ante Karamatić (ivoks) wrote :

Great, thank you. I'm applying the patch for this issue and subscribing main sponsors.

Changed in dkms (Ubuntu):
status: New → Invalid
Changed in drbd8 (Ubuntu):
status: Incomplete → In Progress
Revision history for this message
Ante Karamatić (ivoks) wrote :

Obviously, attaching, not applying :)

Revision history for this message
Ante Karamatić (ivoks) wrote :

Proposed fix for lucid-proposed.

Revision history for this message
crh (chuebner) wrote :

The fix does not work on my freshly kickstarted ubuntu lucid server. The result is the same, dkms complains that no kernel sources are installed despite both generic and server headers are present.

The reason is that dkms tries to use the build link in /lib/modules/2.6.32-21-generic (which does not exist) instead of the one in /lib/modules/2.6.32-21-server (which does and correctly points to the server headers).

The key to the whole issue is the use of uname -r (results in ...-generic) by dkms to determine where the kernel sources are. There either needs to be a fix that creates the correct ...-server reference out of 'uname -r' or a the kernel needs to be renamed ...-server so the build reference does not have to be changed.

Adding a link /lib/modules/2.6.32-21-generic/build -> /usr/src/2.6.32-21-server can serve as a workaround but is not a sustainable solution.

The fix as provided does not work.

Changed in dkms (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Gaëtan Ferez (gferez) wrote :

Hi,

I also tried to test via a kernel 2.6.32-21-server to 2.6.32-22-server but I had no problem passing dkms is properly implemented with the patch on deb package

# apt-get install linux-headers-2.6.32-22-server linux-image-2.6.32-22-server
root@ubuntu:/var/lib/dkms/drbd8# dkms status
drbd8, 8.3.7, 2.6.32-22-server, x86_64: installed
drbd8, 8.3.7, 2.6.32-21-server, x86_64: installed

Chuck Short (zulcss)
summary: - module drbd8 update kernel from 2.6.32-16 to 2.6.32-20
+ [SRU] module drbd8 update kernel from 2.6.32-16 to 2.6.32-20
Changed in dkms (Ubuntu Lucid):
status: New → Won't Fix
Revision history for this message
Chuck Short (zulcss) wrote :

Statement of Impact: DRBD in lucid had a bug that will build a module for all kernels with headers of a running kernel. This bug will be fixed in maverick as soon as it is reproduce there.

The patch attached to this bug will fix the issue in lucid.

TEST CASE:

1. Boot old kernel
2. Install server kernel
3. Install linux-headers-server
4. Install drbd8-source
5. Reboot to the new kernel, drbd8 module will load.

I dont expect any regressions with this patch. If you have any questions please let me know.

Regards
chuck

Revision history for this message
Ante Karamatić (ivoks) wrote :

crh did you install pached drbd8-source or the one from archives? The one in archives isn't fixed yet.

Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted drbd8 into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in drbd8 (Ubuntu Lucid):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Gaëtan Ferez (gferez) wrote :

Hi,

I tested the package in lucid-proposed, and the problem disappear.
drbd module kernel build correctly with the new linux kernel

drbd8, 8.3.7, 2.6.32-21-server, x86_64: installed
drbd8, 8.3.7, 2.6.32-22-server, x86_64: installed

Thanks

Martin Pitt (pitti)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package drbd8 - 2:8.3.7-1ubuntu2.1

---------------
drbd8 (2:8.3.7-1ubuntu2.1) lucid-proposed; urgency=low

  * Use KDIR instead of KERNELDIR variable for headers path
    - thanks Gaëtan Ferez for debugging
    - (LP: #562832)
 -- Ante Karamatic <email address hidden> Mon, 19 May 2010 09:22:17 +0200

Changed in drbd8 (Ubuntu Lucid):
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

copied to maverick, too.

Changed in drbd8 (Ubuntu):
status: In Progress → Fix Released
Changed in dkms (Ubuntu):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.