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

Kirill Tkhai ktkhai at virtuozzo.com
Mon Apr 18 08:11:07 PDT 2016


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.

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;



More information about the CRIU mailing list