autofs-5.0.6 - fix remount of multi mount From: Ian Kent Went accessing a multi-mount only the the offsets that need to be mounted are mounted. But when re-mounting multi-mounts during a restart we need to also traverse into existing mounts and re-connect to triggers mounted within them. --- CHANGELOG | 1 + lib/mounts.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index cb229b4..1aab60b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -59,6 +59,7 @@ - fix remount deadlock. - fix umount recovery of busy direct mount. - fix offset mount point directory removal. +- fix remount of multi mount. 28/06/2011 autofs-5.0.6 ----------------------- diff --git a/lib/mounts.c b/lib/mounts.c index 48a3a4f..eec7e43 100644 --- a/lib/mounts.c +++ b/lib/mounts.c @@ -1661,6 +1661,21 @@ int mount_multi_triggers(struct autofs_point *ap, struct mapent *me, goto cont; mounted += do_mount_autofs_offset(ap, oe, root, offset); + + /* + * If re-constructing a multi-mount it's necessary to walk + * into nested mounts, unlike the usual "mount only what's + * needed as you go" behavior. + */ + if (ap->state == ST_READMAP && ap->flags & MOUNT_FLAG_REMOUNT) { + if (oe->ioctlfd != -1 || + is_mounted(_PROC_MOUNTS, oe->key, MNTS_REAL)) { + char oe_root[PATH_MAX + 1]; + strcpy(oe_root, root); + strcat(oe_root, offset); + mount_multi_triggers(ap, oe, oe_root, strlen(oe_root), base); + } + } cont: offset = cache_get_offset(base, offset, start, &me->multi_list, &pos);