From: Ian Kent <ikent@redhat.com>
authorzoulasc <christos@zoulas.com>
Fri, 21 Mar 2014 00:25:01 +0000 (20:25 -0400)
committerzoulasc <christos@zoulas.com>
Fri, 21 Mar 2014 00:25:01 +0000 (20:25 -0400)
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.

amd/map.c

index 2fad4b7b2c8500a410966811049177e0ea195d7d..8e86b39a6937e73e6e8a0431b6d080071ed49a56 100644 (file)
--- 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);