[CRIU] [PATCH] zdtm/atomic: atomic_inc should return the old value

Pavel Emelyanov xemul at virtuozzo.com
Wed Apr 27 05:05:53 PDT 2016


On 04/27/2016 03:26 AM, Andrey Vagin wrote:
> From: Andrei Vagin <avagin+ppc at gmail.com>
> 
> 00:24:30.269:    44: ERR: test.c:208: Test exited on unexpected signal

And how does s/atomic_inc/atomic_inc_return/g help?

> Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
> ---
>  test/zdtm/lib/arch/ppc64/include/asm/atomic.h | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/test/zdtm/lib/arch/ppc64/include/asm/atomic.h b/test/zdtm/lib/arch/ppc64/include/asm/atomic.h
> index 9463006..bd14cc0 100644
> --- a/test/zdtm/lib/arch/ppc64/include/asm/atomic.h
> +++ b/test/zdtm/lib/arch/ppc64/include/asm/atomic.h
> @@ -47,7 +47,7 @@ ATOMIC_OP(sub, subf)
>  
>  #undef ATOMIC_OP
>  
> -static __inline__ int atomic_inc(atomic_t *v)
> +static __inline__ int atomic_inc_return(atomic_t *v)
>  {
>  	int t;
>  
> @@ -65,6 +65,11 @@ static __inline__ int atomic_inc(atomic_t *v)
>  	return t;
>  }
>  
> +static __inline__ int atomic_inc(atomic_t *v)
> +{
> +	return atomic_inc_return(v) - 1;
> +}
> +
>  static __inline__ void atomic_dec(atomic_t *v)
>  {
>  	int t;
> 



More information about the CRIU mailing list