autofs-5.1.0-beta1 - fix expire when server not responding From: Ian Kent The change to handle expire of symlinks relies on doing a stat(2) call to check if the path to be expired is a symlink. But system calls that invoke a path walk on real mounts need to be avoided during expire because if the server isn't responding they will hang. --- CHANGELOG | 1 + daemon/automount.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index a8d8d31..ba56725 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -17,6 +17,7 @@ - fix incorrect max key length in defaults get_hash(). - fix xfn sets incorrect lexer state. - fix old style key lookup. +- fix expire when server not responding. 28/03/2014 autofs-5.0.9 ======================= diff --git a/daemon/automount.c b/daemon/automount.c index a6a9321..64dc305 100644 --- a/daemon/automount.c +++ b/daemon/automount.c @@ -573,9 +573,13 @@ int umount_multi(struct autofs_point *ap, const char *path, int incl) debug(ap->logopt, "path %s incl %d", path, incl); + /* If path is a mount it can't be a symlink */ + if (is_mounted(_PATH_MOUNTED, path, MNTS_ALL)) + goto real_mount; + if (lstat(path, &st)) { warn(ap->logopt, - "failed to stat mount point directory %s", path); + "failed to stat directory or symlink %s", path); return 1; } @@ -617,6 +621,7 @@ int umount_multi(struct autofs_point *ap, const char *path, int incl) return 0; } +real_mount: is_autofs_fs = 0; if (master_find_submount(ap, path)) is_autofs_fs = 1;