<p dir="ltr">Yes. It's documented in the mount man page.<br>
Thanks for looking at the patch.</p>
<div class="gmail_quote">On Nov 18, 2014 1:04 PM, "Serge Hallyn" <<a href="mailto:serge.hallyn@ubuntu.com">serge.hallyn@ubuntu.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Quoting Abin Shahab (<a href="mailto:ashahab@altiscale.com">ashahab@altiscale.com</a>):<br>
> Bind mounts do not honor filesystem mount options. This change will remount filesystems that are bind mounted if there are changes to filesystem mount options, specifically if the mount is readonly.<br>
<br>
hi,<br>
<br>
Just to make sure I understand what you're saying,<br>
<br>
'mount --bind -o ro /a /b' (when done through mount(2)) will not<br>
actually make /b readonly, so we need to do a remount in that case<br>
to get the -o ro to take effect at the vfsmount instead of the sb.<br>
Is that right?<br>
<br>
> Signed-off-by: Abin Shahab <<a href="mailto:ashahab@altiscale.com">ashahab@altiscale.com</a>><br>
> ---<br>
>  src/lxc/conf.c | 8 +++++---<br>
>  1 file changed, 5 insertions(+), 3 deletions(-)<br>
><br>
> diff --git a/src/lxc/conf.c b/src/lxc/conf.c<br>
> index 5938c3e..a3779de 100644<br>
> --- a/src/lxc/conf.c<br>
> +++ b/src/lxc/conf.c<br>
> @@ -1921,10 +1921,12 @@ static int mount_entry(const char *fsname, const char *target,<br>
>       if ((mountflags & MS_REMOUNT) || (mountflags & MS_BIND)) {<br>
>               DEBUG("remounting %s on %s to respect bind or remount options",<br>
>                     fsname ? fsname : "(none)", target ? target : "(none)");<br>
> -<br>
> +             unsigned long rqd_flags = 0;<br>
> +             if (mountflags & MS_RDONLY)<br>
> +                     rqd_flags |= MS_RDONLY;<br>
>  #ifdef HAVE_STATVFS<br>
>               if (statvfs(fsname, &sb) == 0) {<br>
> -                     unsigned long required_flags = 0;<br>
> +                     unsigned long required_flags = rqd_flags;<br>
>                       if (sb.f_flag & MS_NOSUID)<br>
>                               required_flags |= MS_NOSUID;<br>
>                       if (sb.f_flag & MS_NODEV)<br>
> @@ -1940,7 +1942,7 @@ static int mount_entry(const char *fsname, const char *target,<br>
>                        * mountflags, then skip the remount<br>
>                        */<br>
>                       if (!(mountflags & MS_REMOUNT)) {<br>
> -                             if (!(required_flags & ~mountflags)) {<br>
> +                             if (!(required_flags & ~mountflags) && rqd_flags == 0) {<br>
>                                       DEBUG("mountflags already was %lu, skipping remount",<br>
>                                               mountflags);<br>
>                                       goto skipremount;<br>
> --<br>
> 2.1.0<br>
><br>
> _______________________________________________<br>
> lxc-devel mailing list<br>
> <a href="mailto:lxc-devel@lists.linuxcontainers.org">lxc-devel@lists.linuxcontainers.org</a><br>
> <a href="http://lists.linuxcontainers.org/listinfo/lxc-devel" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-devel</a><br>
_______________________________________________<br>
lxc-devel mailing list<br>
<a href="mailto:lxc-devel@lists.linuxcontainers.org">lxc-devel@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-devel" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-devel</a><br>
</blockquote></div>