[01/22] image: Fix "collect happenned" flag

Submitted by Pavel Emelianov on June 30, 2017, 10:55 a.m.

Details

Message ID 59a2de81-5b9d-5714-40d9-95f1ccf1369e@virtuozzo.com
State Accepted
Series "Merge images with different files into one"
Headers show

Commit Message

Pavel Emelianov June 30, 2017, 10:55 a.m.
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".

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
---
 criu/file-lock.c | 5 -----
 criu/protobuf.c  | 2 +-
 2 files changed, 1 insertion(+), 6 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/file-lock.c b/criu/file-lock.c
index 2d4036c..821821f 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 5c770b8..219c7c0 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);