From d73a08b176d40b3b7a2a698f110b528bade321d5 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Fri, 30 Jun 2017 13:55:47 +0300 Subject: [PATCH] image: Fix "collect happenned" flag This flag now means "image was opened", while the "empty image" concept makes this always true. Since there's one user of this flag, which is obviously incorrect, remove the latter and fix the former to mean "at least one object was read". Reviewed-by: Kirill Tkhai Signed-off-by: Pavel Emelyanov Signed-off-by: Andrei Vagin --- criu/file-lock.c | 5 ----- criu/protobuf.c | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/criu/file-lock.c b/criu/file-lock.c index 2d4036c75..821821f59 100644 --- a/criu/file-lock.c +++ b/criu/file-lock.c @@ -426,11 +426,6 @@ int prepare_file_locks(int pid) if (!opts.handle_file_locks) return 0; - if (!(file_locks_cinfo.flags & COLLECT_HAPPENED)) { - pr_warn("Per-pid file locks are deprecated\n"); - return -1; - } - return restore_file_locks(pid); } diff --git a/criu/protobuf.c b/criu/protobuf.c index 5c770b847..219c7c088 100644 --- a/criu/protobuf.c +++ b/criu/protobuf.c @@ -186,7 +186,6 @@ int collect_image(struct collect_image_info *cinfo) if (!img) return -1; - cinfo->flags |= COLLECT_HAPPENED; if (cinfo->flags & COLLECT_SHARED) { o_alloc = shmalloc; o_free = shfree_last; @@ -210,6 +209,7 @@ int collect_image(struct collect_image_info *cinfo) break; } + cinfo->flags |= COLLECT_HAPPENED; ret = cinfo->collect(obj, msg, img); if (ret < 0) { o_free(obj);