From 6275dfdb7e51d018bb02eaed347e4e66f4a7b01a Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 09 2020 08:03:57 +0000 Subject: Apply patch autofs-5.1.4-set-bind-mount-as-propagation-slave.patch patch_name: autofs-5.1.4-set-bind-mount-as-propagation-slave.patch present_in_specfile: true --- diff --git a/CHANGELOG b/CHANGELOG index a06ecfb..e70f8a3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -30,6 +30,7 @@ xx/xx/2018 autofs-5.1.5 - fix program usage message. - fix update_negative_cache() map source usage. - mark removed cache entry negative. +- set bind mount as propagation slave. 19/12/2017 autofs-5.1.4 - fix spec file url. diff --git a/modules/mount_bind.c b/modules/mount_bind.c index 5effa88..fe1ad9b 100644 --- a/modules/mount_bind.c +++ b/modules/mount_bind.c @@ -20,6 +20,7 @@ #include #include #include +#include #define MODULE_MOUNT #include "automount.h" @@ -183,8 +184,21 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int debug(ap->logopt, MODPREFIX "mounted %s type %s on %s", what, fstype, fullpath); - return 0; } + + /* The bind mount has succeeded but if the target + * mount is propagation shared propagation of child + * mounts (autofs offset mounts for example) back to + * the target of the bind mount must be avoided or + * autofs trigger mounts will deadlock. + */ + err = mount(NULL, fullpath, NULL, MS_SLAVE, NULL); + if (err) + warn(ap->logopt, + "failed to set propagation type for %s", + fullpath); + + return 0; } else { char *cp; char basepath[PATH_MAX];