macos: lock module against unload during shutdown

during shutdown, once umount finished, it was possible to
unload the module before shutdown completed. fix that.

Change-Id: I7eae5210ec9553fa862d96148f963dcdfee79c4b
Reviewed-on: http://gerrit.openafs.org/7245
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
This commit is contained in:
Derrick Brashear 2012-04-18 11:58:03 -04:00
parent 749cb03e3c
commit a08f9baa76

View File

@ -115,6 +115,8 @@ afs_modunload(struct kmod_info * kmod_info, void *data)
{
if (afs_globalVFS)
return KERN_FAILURE;
if ((afs_initState != 0) || (afs_shuttingdown))
return KERN_FAILURE;
#ifdef AFS_DARWIN80_ENV
if (vfs_fsremove(afs_vfstable))
return KERN_FAILURE;