[CRIU] [PATCH 2/6] mnt: restore shared mounts in a correct shared group

Andrei Vagin avagin at virtuozzo.com
Thu Sep 22 12:40:08 PDT 2016


On Wed, Sep 21, 2016 at 10:19:56AM +0300, Pavel Emelyanov wrote:
> On 09/13/2016 07:19 AM, Andrei Vagin wrote:
> > From: Andrei Vagin <avagin at virtuozzo.com>
> > 
> > Currently when we have a shared group, we set a source mount for all
> > of them and then we need to update a source mount when we mount a first
> > mount from a shared group, because a shared id can be only inherited.
> 
> So is it a bugfix? Can we have a test for that?

The test from this series covers this case.

> 
> > Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
> > ---
> >  criu/mount.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/criu/mount.c b/criu/mount.c
> > index 797edd7..1121ce0 100644
> > --- a/criu/mount.c
> > +++ b/criu/mount.c
> > @@ -2181,7 +2181,9 @@ static int propagate_siblings(struct mount_info *mi)
> >  	 * to inherite shared group or master id
> >  	 */
> >  	list_for_each_entry(t, &mi->mnt_share, mnt_share) {
> > -		if (t->mounted || t->bind)
> > +		if (t->mounted)
> > +			continue;
> > +		if (t->bind && t->bind->shared_id == t->shared_id)
> >  			continue;
> >  		pr_debug("\t\tBind share %s\n", t->mountpoint);
> >  		t->bind = mi;
> > 
> 


More information about the CRIU mailing list