[OpenAFS-devel] 1.4.1 build problem with 2.6.9 kernel

Derek Atkins warlord@MIT.EDU
Tue, 18 Apr 2006 11:23:40 -0400


Durn, I shouldn't tried the rc releases on more systems...
1.4.1 wont build on Linux 2.6.9 because the module_param_array()
macro is slightly different than on newer systems

Here's the build error I got on FC3 2.6.9-1.667-i586:

  CC [M]  /usr/src/redhat/BUILD/openafs-1.4.1/src/libafs/MODLOAD-2.6.9-1.667-SP/
osi_probe.o
/usr/src/redhat/BUILD/openafs-1.4.1/src/libafs/MODLOAD-2.6.9-1.667-SP/osi_probe.
c:121: error: invalid lvalue in unary `&'
/usr/src/redhat/BUILD/openafs-1.4.1/src/libafs/MODLOAD-2.6.9-1.667-SP/osi_probe.
c:121: error: initializer element is not constant
/usr/src/redhat/BUILD/openafs-1.4.1/src/libafs/MODLOAD-2.6.9-1.667-SP/osi_probe.
c:121: error: (near initialization for `__param_arr_sys_call_table_addr.num')
/usr/src/redhat/BUILD/openafs-1.4.1/src/libafs/MODLOAD-2.6.9-1.667-SP/osi_probe.
c:138: error: invalid lvalue in unary `&'
/usr/src/redhat/BUILD/openafs-1.4.1/src/libafs/MODLOAD-2.6.9-1.667-SP/osi_probe.
c:138: error: initializer element is not constant
/usr/src/redhat/BUILD/openafs-1.4.1/src/libafs/MODLOAD-2.6.9-1.667-SP/osi_probe.
c:138: error: (near initialization for `__param_arr_probe_ignore_syscalls.num')
make[6]: *** [/usr/src/redhat/BUILD/openafs-1.4.1/src/libafs/MODLOAD-2.6.9-1.667
-SP/osi_probe.o] Error 1
make[5]: *** [_module_/usr/src/redhat/BUILD/openafs-1.4.1/src/libafs/MODLOAD-2.6
.9-1.667-SP] Error 2
make[5]: Leaving directory `/usr/src/kernels/2.6.9-1.667-i586'
make[4]: *** [openafs.ko] Error 2

Here's the definition of the macro on 2.6.9:

/* Comma-separated array: num is set to number they actually specified. */
#define module_param_array_named(name, array, type, num, perm)          \
        static struct kparam_array __param_arr_##name                   \
        = { ARRAY_SIZE(array), &num, param_set_##type, param_get_##type,\
            sizeof(array[0]), array };                                  \
        module_param_call(name, param_array_set, param_array_get,       \
                          &__param_arr_##name, perm)

#define module_param_array(name, type, num, perm)               \
        module_param_array_named(name, name, type, num, perm)

Which appears different that the definition on my 2.6.12 system:

/* Comma-separated array: *nump is set to number they actually specified. */
#define module_param_array_named(name, array, type, nump, perm)         \
        static struct kparam_array __param_arr_##name                   \
        = { ARRAY_SIZE(array), nump, param_set_##type, param_get_##type,\
            sizeof(array[0]), array };                                  \
        module_param_call(name, param_array_set, param_array_get,       \
                          &__param_arr_##name, perm);                   \
        __MODULE_PARM_TYPE(name, "array of " #type)

So I don't think we can just blankly use the existence of
module_parm_array() to know whether to use that..   :-(

-derek
-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available