autofs-5.0.3 - don't close direct root From: Ian Kent For direct mount multi-mounts with no real mount at their base we need to leave the file handle open so they will be expired. This patch corrects the check done at mount completion to do this so they will be expired. --- CHANGELOG | 1 + daemon/direct.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 4c7a37d..23680bc 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -40,6 +40,7 @@ - fix incorrect multi-mount mountpoint calcualtion. - fix map out of order map re-read on hup signal. - fix nisplus error return check and use after free error. +- fix rootless direct multi-mount expire. 14/01/2008 autofs-5.0.3 ----------------------- diff --git a/daemon/direct.c b/daemon/direct.c index b94601a..5b02dcf 100644 --- a/daemon/direct.c +++ b/daemon/direct.c @@ -1311,8 +1311,17 @@ static void *do_mount_direct(void *arg) !master_find_submount(ap, mt.name))) close_fd = 1; cache_writelock(mt.mc); - if (!close_fd && (me = cache_lookup_distinct(mt.mc, mt.name))) - me->ioctlfd = mt.ioctlfd; + if ((me = cache_lookup_distinct(mt.mc, mt.name))) { + /* + * Careful here, we need to leave the file handle open + * for direct mount multi-mounts with no real mount at + * their base so they will be expired. + */ + if (close_fd && me == me->multi) + close_fd = 0; + if (!close_fd) + me->ioctlfd = mt.ioctlfd; + } send_ready(ap->logopt, mt.ioctlfd, mt.wait_queue_token); cache_unlock(mt.mc); if (close_fd)