Commit
a27bed59cae1a4244429c752edfde0a8363c8a3b moved init_hckernel_init
to osi_Init. On Darwin (AFS_DARWIN80_ENV), MUTEX_INIT
(called by init_hckernel_init) uses openafs_lck_grp as the argument of
one of the functions called during the initialization of the mutex in
question. Since openafs_lck_grp was not allocated yet, we crash.
To fix this problem, call MUTEX_SETUP() before osi_Init() on Darwin.
Change-Id: Ib53118208d3ca7982e712768f334299e3d948805
Reviewed-on: https://gerrit.openafs.org/13065
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
afs_modload(struct kmod_info *kmod_info, void *data)
{
int ret;
- osi_Init();
#ifdef AFS_DARWIN80_ENV
MUTEX_SETUP();
+ osi_Init();
afs_global_lock = lck_mtx_alloc_init(openafs_lck_grp, 0);
if (ret = vfs_fsadd(&afs_vfsentry, &afs_vfstable)) {
return KERN_FAILURE;
}
#else
+ osi_Init();
memset(&afs_vfsconf, 0, sizeof(struct vfsconf));
strcpy(afs_vfsconf.vfc_name, "afs");
afs_vfsconf.vfc_vfsops = &afs_vfsops;