<div dir="ltr"><br><div>the continuation of the thread.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 19, 2014 at 9:37 AM, Serge Hallyn <span dir="ltr"><<a href="mailto:serge.hallyn@ubuntu.com" target="_blank">serge.hallyn@ubuntu.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Quoting Abin Shahab (<a href="mailto:ashahab@altiscale.com">ashahab@altiscale.com</a>):<br>
> Yes. It's documented in the mount man page.<br>
> Thanks for looking at the patch.<br>
> On Nov 18, 2014 1:04 PM, "Serge Hallyn" <<a href="mailto:serge.hallyn@ubuntu.com">serge.hallyn@ubuntu.com</a>> wrote:<br>
><br>
> > 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<br>
> > remount filesystems that are bind mounted if there are changes to<br>
> > 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>
</span>Thanks, great catch.<br>
<br>
Acked-by: Serge E. Hallyn <<a href="mailto:serge.hallyn@ubuntu.com">serge.hallyn@ubuntu.com</a>><br>
<br>
Stéphane, this one is pretty important, please do get this into stable<br>
as well.<br>
<div class="HOEnZb"><div class="h5"><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<br>
> > char *target,<br>
> > > if ((mountflags & MS_REMOUNT) || (mountflags & MS_BIND)) {<br>
> > > DEBUG("remounting %s on %s to respect bind or remount<br>
> > options",<br>
> > > fsname ? fsname : "(none)", target ? target :<br>
> > "(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<br>
> > char *target,<br>
> > > * mountflags, then skip the remount<br>
> > > */<br>
> > > if (!(mountflags & MS_REMOUNT)) {<br>
> > > - if (!(required_flags & ~mountflags)) {<br>
> > > + if (!(required_flags & ~mountflags) &&<br>
> > rqd_flags == 0) {<br>
> > > DEBUG("mountflags already was %lu,<br>
> > skipping remount",<br>
> > > mountflags);<br>
> > > goto skipremount;<br>
> > > --<br>
> > > 2.1.0<br></div></div></blockquote></div><div class="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr" style="display:inline!important"><div dir="ltr" style="display:inline!important"><div dir="ltr" style="display:inline!important"><div dir="ltr"><div dir="ltr" style="display:inline!important"><div dir="ltr" style="display:inline!important"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr" style="display:inline!important"><div dir="ltr" style="display:inline!important"><div dir="ltr" style="display:inline!important"><div dir="ltr" style="display:inline!important"></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div></div>