[CRIU] [PATCH] parasite: remove the hash table for tid_state-s

Cyrill Gorcunov gorcunov at openvz.org
Wed May 15 15:52:04 EDT 2013


On Wed, May 15, 2013 at 11:38:01PM +0400, Andrey Vagin wrote:
> @@ -633,16 +599,11 @@ static int noinline parasite_daemon(struct parasite_init_args *args)
>  {
>  	struct tid_state_s *s;
>  	unsigned long new_sp = 0;
> -	bool is_leader = false;
> -
> -	s = find_thread_state(args->real);
> -	if (!s)
> -		return -ENOENT;
> +	bool is_leader = (args->id == 0);
>  
> -	if (s->real == thread_leader->real)
> -		is_leader = true;
> +	s = &tid_state[args->id];

Maybe we should add some BUG_ON(args->id > tid_state array-size) here?

	Cyrill


More information about the CRIU mailing list