[ENBD] enbd module 2.6.13-15 kernel fails to modprobe or insmod

Peter T. Breuer ptb at inv.it.uc3m.es
Tue Aug 22 03:48:55 MDT 2006


"Also sprach Norbert Pieroth:"
> >                         lo->disk = NULL;
> >                         ENBD_ERROR(
> >                             "Not enough memory to make a queue struct\n");
> >                         goto out_nomem;
> >                 }
> >                 enbd_init_queue(lo, disk->queue);
> >         }
> >         if (register_blkdev (major, "nbd")) {
> >                 ENBD_ERROR ("Unable to register major number %d for NBD\n",
> >                            major);
> >                 return -EIO;
> >         }
> >         ENBD_INFO ("registered device at major %d\n", major);
> > 
> sorry for not responding directly. I was out of the office a few days.
> I followed your suggestions by disabling the DEBUG switch and changing
> the name of the log function. But it all changed nothing on the behaviour.

Add a few printks in that section of code. That'll show what the
problem is for sure. I would guess that there's a special SUSE kernel
gotcha here, since the code above is entirely innocuous, yet it
provokes a segfault on yoru kernel!

> As next I've set up a SuSE 10.0 with kernel version 2.6.15.4 from kernel.org.
> The build worked, the machine is running nice, but the kernelmodule (enbd.ko) couldn't be loaded.
> There was an unknown symbol (enbd: unknown symbol strcpy) in the module.

You have probably built it using -Os instead of -O2.  Use -O2.  -Os
optimizes for SIZE, which means not inlining any code.  The kernel
expects strcpy to be inlined and does not export it (indeed, my code
does not mention strcpy, so this is purely a kernel thing) and thus
optimizing for size in a module will not always work.

This rather implies to me that the enbd version you are using is not
the latest, because the current makefile says:

   ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
   # ptb says to go shoot yourself until gcc compiles -Os properly
   CONFIG_CC_OPTIMIZE_FOR_SIZE :=
   endif


Peter



More information about the ENBD mailing list