From: zoulasc Date: Fri, 21 Mar 2014 00:25:01 +0000 (-0400) Subject: From: Ian Kent X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=529503eecdd02281e789c54e7430f2369899a0cf;p=am-utils-6.2.git From: Ian Kent When using an autofs multi-level mount map amd can fail to umount NFS leaf mounts causing shutdown to fail. It also can cause amd to SEGV because, even though umounts fail, the autofs mount control structure is freed and a later umount attempt doesn't check if this struct is valid before using it. The cause of the umount failure appears to be the background umount of NFS mounts at the leaf of the tree not finishing before the autofs file system mounts above are attempted. It isn't worth adding a patch to check if the autofs mount control structure is valid because if it isn't, in this case, amd doesn't crash but still becomes unresponsive. --- diff --git a/amd/map.c b/amd/map.c index 2fad4b7b..8e86b39a 100644 --- a/amd/map.c +++ b/amd/map.c @@ -946,7 +946,8 @@ unmount_mp(am_node *mp) #endif /* HAVE_FS_AUTOFS */ if ((mf->mf_fsflags & FS_UBACKGROUND) && - (mf->mf_flags & MFF_MOUNTED)) { + (mf->mf_flags & MFF_MOUNTED) && + !(mf->mf_flags & MFF_ON_AUTOFS)) { dlog("Trying unmount in background"); run_task(unmount_node, (opaque_t) mp, free_map_if_success, (opaque_t) mp);