Re: Module Versioning Problems

Hans Lermen (lermen@elserv.ffm.fgan.de)
Mon, 16 Sep 1996 01:16:57 +0200


On Sun, 15 Sep 1996, Alan Cox wrote:

> We have a nasty module version bug at the moment as genksyms version ids
> for SMP and uniprocessor kernels match but the code doesnt work from
> one to the other (in fact getting it wrong can lose you things like
> file systems).
>
> [ ... ]
> Am I right in thinking I can do this... and if so would the modules folks
> care to confirm it and submit the change to Linus
>
> #ifdef __SMP__ /* SMP machine */
> /* Generate symbol_S0123456 */
> #define _set_ver(sym,vers) sym ## _S ## vers
> #else
> /* Generate symbol_R0123456 */
> #define _set_ver(sym,vers) sym ## _R ## vers
> #endif /* SMP */
>

Yes, I guess this would work though it needs to adapt the modules package.

However, it doesn't solve the problem for non-MODVERSION compilations.
For these we would need a variable in kernel (e.g. smp_num_cpus), which
is compiled in also in non-SMP kernel (currently it is #ifdef __SMP__).
The modules, if compiled under SMP should have a reference to this
variable (could be in <linux/module.h>) and insmod could take care of the rest.
This solution would solve both cases, with or without MODVERSION and the
changes in the modules package are minimal.

Hans
<lermen@fgan.de>