am-utils-6.1.5 - handle ENOENT umount return for autofs mounts From: Ian Kent 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 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/amd/map.c b/amd/map.c index 8e86b39..e6d14b8 100644 --- 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 {