[CRIU] [PATCH CRIU 2/4] mount: do not make external mounts to be private if not needed

Tycho Andersen tycho.andersen at canonical.com
Thu Jan 21 05:33:55 PST 2016


On Thu, Jan 21, 2016 at 12:25:05AM +0300, Pavel Tikhomirov wrote:
> On 01/20/2016 08:47 PM, Tycho Andersen wrote:
> >On Wed, Jan 20, 2016 at 06:42:56PM +0300, Pavel Tikhomirov wrote:
> >>external mounts always have shared == master == 0
> >
> >I don't understand the patch notes here; if external mounts always
> >have this, why is this patch needed? Isn't it a no-op?
> 
> I mean, first, we set force_private_remount only once inside do_bind_mount
> in block "if (mi->external) {...}" but for that case we always have
> "force_private_remount || (!shared && !master)" equal to true as shared is 0
> and master is 0. So now force_private_remount has no purpose as I can see.

If there is no purpose, though, we should just get rid of it. But
doesn't a remount need to be forced when the sharing is internal? How
would this case be handled if you drop force_private_remount?

> So I propose to change it to other behavior - just ignore unset master and
> slave for mounts with mi->external != 0.
> 
> >
> >>https://jira.sw.ru/browse/PSBM-42829
> >>Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
> >>---
> >>  mount.c | 3 ++-
> >>  1 file changed, 2 insertions(+), 1 deletion(-)
> >>
> >>diff --git a/mount.c b/mount.c
> >>index e267e10..424949a 100644
> >>--- a/mount.c
> >>+++ b/mount.c
> >>@@ -2392,7 +2392,8 @@ static int do_bind_mount(struct mount_info *mi)
> >>  	 * shared - the mount is in the same shared group with mi->bind
> >>  	 * mi->shared_id && !shared - create a new shared group
> >>  	 */
> >>-	if (restore_shared_options(mi, force_private_remount || (!shared && !master),
> >>+	if (restore_shared_options(mi, force_private_remount
> >>+					|| (!shared && !master && !mi->external),
> >>  					mi->shared_id && !shared,
> >>  					mi->master_id && !master))
> >>  		return -1;
> >>--
> >>1.9.3
> >>


More information about the CRIU mailing list