[CRIU] [PATCH] restore: unlock network before disabling repair mode on sockets

Andrew Vagin avagin at parallels.com
Mon Jul 15 07:20:35 EDT 2013


On Mon, Jul 15, 2013 at 03:07:15PM +0400, Pavel Emelyanov wrote:
> On 07/14/2013 05:47 PM, Andrey Vagin wrote:
> > Window probe is sent during disabling repair mode on a socket, so
> > network must be unlocked in this moment.
> 
> I thought we've discussed this thing already and kinda fixed one.

I have a similar remembrances, but look at the code
Currently network_unlock and rst_tcp_repair_off are called on the same
stage, so we have a race condition.


> What's wrong?
> 
> > https://bugzilla.openvz.org/show_bug.cgi?id=2670
> > Signed-off-by: Andrey Vagin <avagin at openvz.org>
> > ---
> >  cr-restore.c | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> > 
> > diff --git a/cr-restore.c b/cr-restore.c
> > index 1d014e1..d7f1e31 100644
> > --- a/cr-restore.c
> > +++ b/cr-restore.c
> > @@ -1300,6 +1300,13 @@ static int restore_root_task(struct pstree_item *init)
> >  		goto out;
> >  
> >  	pr_info("Wait until all tasks are restored\n");
> > +	ret = restore_wait_inprogress_tasks();
> > +	if (ret < 0)
> > +		goto out;
> > +
> > +	/* Unlock network before disabling repair mode on sockets */
> > +	network_unlock();
> > +
> >  	ret = restore_switch_stage(CR_STATE_RESTORE_CREDS);
> >  	if (ret < 0)
> >  		goto out;
> > @@ -1313,7 +1320,6 @@ static int restore_root_task(struct pstree_item *init)
> >  		goto out;
> >  	}
> >  
> > -	network_unlock();
> >  out:
> >  	if (ret < 0) {
> >  		struct pstree_item *pi;
> > 
> 
> 


More information about the CRIU mailing list