[CRIU] [PATCH 2/3] files: split collect_fd on allocate_fd and handle_fd

Pavel Emelyanov xemul at virtuozzo.com
Wed Aug 10 05:34:51 PDT 2016


> @@ -723,14 +732,23 @@ static int collect_fd(int pid, FdinfoEntry *e, struct rst_info *rst_info)
>  	else
>  		collect_gen_fd(new_le, rst_info);
>  
> -	collect_used_fd(new_le, rst_info);
> -
>  	list_add_tail(&new_le->desc_list, &le->desc_list);
>  	new_le->desc = fdesc;
>  
>  	return 0;
>  }
>  
> +static int collect_fd(int pid, FdinfoEntry *e, struct rst_info *rst_info)
> +{
> +	struct fdinfo_list_entry *le;
> +
> +	le = allocate_fd(pid, e, rst_info);
> +	if (le == NULL)
> +		return -1;
> +
> +	return handle_fd(le, rst_info);
> +}
> +

Presence of this function even after patching makes me think, that after collect
stage you're still not 100% sure which fds are used which are not.

-- Pavel


More information about the CRIU mailing list