From: Ian Kent <ikent@redhat.com>
authorzoulasc <christos@zoulas.com>
Fri, 21 Mar 2014 00:29:18 +0000 (20:29 -0400)
committerzoulasc <christos@zoulas.com>
Fri, 21 Mar 2014 00:29:18 +0000 (20:29 -0400)
An ENOENT return from umount(2) means the kernel path walk couldn't
resolve the path of the mount to a dentry. In that case there can't
be an autofs waitq entry waiting for notification, since there's no
dentry, so don't even try to notify the kernel.

amd/map.c

index 8e86b39a6937e73e6e8a0431b6d080071ed49a56..e6d14b8cc9f3843d55889d58c6978b7bcf30c9be 100644 (file)
--- a/amd/map.c
+++ b/amd/map.c
@@ -873,10 +873,12 @@ free_map_if_success(int rc, int term, opaque_t arg)
     else
       plog(XLOG_ERROR, "%s: unmount: %s", mp->am_path, strerror(rc));
 #ifdef HAVE_FS_AUTOFS
-    if (mf->mf_flags & MFF_IS_AUTOFS)
-      autofs_get_mp(mp);
-    if (mp->am_flags & AMF_AUTOFS)
-      autofs_umount_failed(mp);
+    if (rc != ENOENT) {
+      if (mf->mf_flags & MFF_IS_AUTOFS)
+        autofs_get_mp(mp);
+      if (mp->am_flags & AMF_AUTOFS)
+        autofs_umount_failed(mp);
+    }
 #endif /* HAVE_FS_AUTOFS */
     amd_stats.d_uerr++;
   } else {