[lxc-devel] [PATCH] Remounts bind mounts if read-only flag is provided

Serge Hallyn serge.hallyn at ubuntu.com
Wed Nov 19 14:35:56 UTC 2014


Quoting Michael Tokarev (mjt at tls.msk.ru):
> 19.11.2014 00:04, Serge Hallyn пишет:
> > Quoting Abin Shahab (ashahab at altiscale.com):
> >> 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.
> > 
> > hi,
> > 
> > Just to make sure I understand what you're saying,
> > 
> > 'mount --bind -o ro /a /b' (when done through mount(2)) will not
> > actually make /b readonly, so we need to do a remount in that case
> > to get the -o ro to take effect at the vfsmount instead of the sb.
> > Is that right?
> 
> And the way to achieve this is to add 'bind' to the remount flags
> to change ro attr for the bindmount:
> 
>  mount --bind -o remount,rw /a /b
>  mount --bind -o remount,ro /a /b
> 
> this will make vfsmount readwrite or readonly without touching
> the sb.
> 
> Thanks,

Right, but this is using mount(2) in the lxc code :)


More information about the lxc-devel mailing list