[RESEND,v2,2/5] restorer: skip aio restore in check-only mode

Submitted by Adrian Reber on May 23, 2017, 9:42 a.m.

Details

Message ID 1495532535-22405-2-git-send-email-adrian@lisas.de
State New
Series "Series without cover letter"
Headers show

Commit Message

Adrian Reber May 23, 2017, 9:42 a.m.
From: Adrian Reber <areber@redhat.com>

Signed-off-by: Adrian Reber <areber@redhat.com>
---
 criu/pie/restorer.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/pie/restorer.c b/criu/pie/restorer.c
index 736c125..f18b76e 100644
--- a/criu/pie/restorer.c
+++ b/criu/pie/restorer.c
@@ -1364,9 +1364,11 @@  long __export_restore_task(struct task_restore_args *args)
 	 * up AIO rings.
 	 */
 
-	for (i = 0; i < args->rings_n; i++)
-		if (restore_aio_ring(&args->rings[i]) < 0)
-			goto core_restore_end;
+	if (!args->check_only) {
+		for (i = 0; i < args->rings_n; i++)
+			if (restore_aio_ring(&args->rings[i]) < 0)
+				goto core_restore_end;
+	}
 
 	/*
 	 * Finally restore madivse() bits

Comments

Pavel Emelyanov May 24, 2017, 1:12 p.m.
On 05/23/2017 12:42 PM, Adrian Reber wrote:
> From: Adrian Reber <areber@redhat.com>

Can you add a comment saying why AIO should be skipped on check-only restore?

> Signed-off-by: Adrian Reber <areber@redhat.com>
> ---
>  criu/pie/restorer.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/criu/pie/restorer.c b/criu/pie/restorer.c
> index 736c125..f18b76e 100644
> --- a/criu/pie/restorer.c
> +++ b/criu/pie/restorer.c
> @@ -1364,9 +1364,11 @@ long __export_restore_task(struct task_restore_args *args)
>  	 * up AIO rings.
>  	 */
>  
> -	for (i = 0; i < args->rings_n; i++)
> -		if (restore_aio_ring(&args->rings[i]) < 0)
> -			goto core_restore_end;
> +	if (!args->check_only) {
> +		for (i = 0; i < args->rings_n; i++)
> +			if (restore_aio_ring(&args->rings[i]) < 0)
> +				goto core_restore_end;
> +	}
>  
>  	/*
>  	 * Finally restore madivse() bits
>
Adrian Reber May 24, 2017, 3:08 p.m.
On Wed, May 24, 2017 at 04:12:59PM +0300, Pavel Emelyanov wrote:
> On 05/23/2017 12:42 PM, Adrian Reber wrote:
> > From: Adrian Reber <areber@redhat.com>
> 
> Can you add a comment saying why AIO should be skipped on check-only restore?

I was hoping you would know ;-) If I restore AIO during check it fails
during real restore in AIO. No idea how this is connected.

> > Signed-off-by: Adrian Reber <areber@redhat.com>
> > ---
> >  criu/pie/restorer.c | 8 +++++---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> > 
> > diff --git a/criu/pie/restorer.c b/criu/pie/restorer.c
> > index 736c125..f18b76e 100644
> > --- a/criu/pie/restorer.c
> > +++ b/criu/pie/restorer.c
> > @@ -1364,9 +1364,11 @@ long __export_restore_task(struct task_restore_args *args)
> >  	 * up AIO rings.
> >  	 */
> >  
> > -	for (i = 0; i < args->rings_n; i++)
> > -		if (restore_aio_ring(&args->rings[i]) < 0)
> > -			goto core_restore_end;
> > +	if (!args->check_only) {
> > +		for (i = 0; i < args->rings_n; i++)
> > +			if (restore_aio_ring(&args->rings[i]) < 0)
> > +				goto core_restore_end;
> > +	}
> >  
> >  	/*
> >  	 * Finally restore madivse() bits
> > 

		Adrian
Andrei Vagin May 30, 2017, 5:41 p.m.
On Wed, May 24, 2017 at 05:08:36PM +0200, Adrian Reber wrote:
> On Wed, May 24, 2017 at 04:12:59PM +0300, Pavel Emelyanov wrote:
> > On 05/23/2017 12:42 PM, Adrian Reber wrote:
> > > From: Adrian Reber <areber@redhat.com>
> > 
> > Can you add a comment saying why AIO should be skipped on check-only restore?
> 
> I was hoping you would know ;-) If I restore AIO during check it fails
> during real restore in AIO. No idea how this is connected.

because we don't restore vma-s (restore_priv_vma_content)
> 
> > > Signed-off-by: Adrian Reber <areber@redhat.com>
> > > ---
> > >  criu/pie/restorer.c | 8 +++++---
> > >  1 file changed, 5 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/criu/pie/restorer.c b/criu/pie/restorer.c
> > > index 736c125..f18b76e 100644
> > > --- a/criu/pie/restorer.c
> > > +++ b/criu/pie/restorer.c
> > > @@ -1364,9 +1364,11 @@ long __export_restore_task(struct task_restore_args *args)
> > >  	 * up AIO rings.
> > >  	 */
> > >  
> > > -	for (i = 0; i < args->rings_n; i++)
> > > -		if (restore_aio_ring(&args->rings[i]) < 0)
> > > -			goto core_restore_end;
> > > +	if (!args->check_only) {
> > > +		for (i = 0; i < args->rings_n; i++)
> > > +			if (restore_aio_ring(&args->rings[i]) < 0)
> > > +				goto core_restore_end;
> > > +	}
> > >  
> > >  	/*
> > >  	 * Finally restore madivse() bits
> > > 
> 
> 		Adrian