2005-03-08 Erez Zadok <ezk@cs.sunysb.edu>
+ * amd/map.c (umount_exported): when unmounting file systems on
+ exit (when amd.conf global unmount_on_exit=yes), use unmount_mp()
+ instead of unmount_node() because the latter always unmounts in
+ the foreground, whereas the former unmounts in the bg/fg as
+ needed. Unmounting always in the foreground has two problems: (1)
+ if the unmount hangs, amd hangs, and (2) for type:=program, the
+ unmount script is execve'd(!) thus replacing the main amd process,
+ which never gets to finish up, leaving the amd mount points hung.
+
* NEWS: mention new feature of executable maps.
* AUTHORS: Acknowledge Erik Kline.
* don't hang on exit if debug_options=mtab was used
* utimeout=N mount option works with non-nfs types (ufs, pcfs, etc.)
* SEGV (null pointer deref) in type:=program and type:=cachefs
+ * unmount_on_exit of type:=program caused amd to hang
*** Notes specific to am-utils version 6.1b4
* SUCH DAMAGE.
*
*
- * $Id: map.c,v 1.51 2005/01/18 03:01:24 ib42 Exp $
+ * $Id: map.c,v 1.52 2005/03/09 02:29:55 ezk Exp $
*
*/
mf->mf_flags &= ~MFF_MKMNT;
if (gopt.flags & CFM_UNMOUNT_ON_EXIT || mp->am_flags & AMF_AUTOFS) {
plog(XLOG_INFO, "on-exit attempt to unmount %s", mf->mf_mount);
-#ifdef HAVE_FS_AUTOFS
- if (mf->mf_flags & MFF_IS_AUTOFS)
- autofs_release_mp(mp);
-#endif /* HAVE_FS_AUTOFS */
- unmount_node((opaque_t) mp);
+ /*
+ * use unmount_mp, not unmount_node, so that unmounts be
+ * backgrounded as needed.
+ */
+ unmount_mp((opaque_t) mp);
}
am_unmounted(mp);
exported_ap[i] = 0;
* SUCH DAMAGE.
*
*
- * $Id: am_utils.h,v 1.62 2005/03/04 18:42:43 ezk Exp $
+ * $Id: am_utils.h,v 1.63 2005/03/09 02:29:55 ezk Exp $
*
*/
# define amuDebug(x) (debug_flags & (x))
# define dlog if (amuDebug(D_FULL)) dplog
+/* my favorite debugging tool -Erez */
+#define EZKDBG plog(XLOG_INFO,"EZK:%s:%s:%d\n",__FILE__,__FUNCTION__,__LINE__)
+
# ifdef DEBUG_MEM
/*
* If debugging memory, then call a special freeing function that logs