[CRIU] [PATCH] files: Correctly handle tasks with no open file descriptors

Andrew Vagin avagin at virtuozzo.com
Mon Apr 18 11:21:55 PDT 2016


On Mon, Apr 18, 2016 at 06:11:07PM +0300, Kirill Tkhai wrote:
> Do not fail, if task doesn't have open files. This fixes
> zdtm/static/fd test, which is broken now:
> 
> (00.004411) Error (cr-dump.c:1312): Dump files (pid: 25) failed with -1
> (00.004548) Error (cr-dump.c:1614): Dumping FAILED.
>

Acked-by: Andrew Vagin <avagin at virtuozzo.com> 
> Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
> ---
>  criu/files.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/criu/files.c b/criu/files.c
> index f02e87a..67c6721 100644
> --- a/criu/files.c
> +++ b/criu/files.c
> @@ -481,6 +481,7 @@ int dump_task_files_seized(struct parasite_ctl *ctl, struct pstree_item *item,
>  	if (!img)
>  		goto err;
>  
> +	ret = 0; /* Don't fail if nr_fds == 0 */
>  	for (off = 0; off < dfds->nr_fds; off += nr_fds) {
>  		if (nr_fds + off > dfds->nr_fds)
>  			nr_fds = dfds->nr_fds - off;
> 
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list