[RESEND,v2,1/5] check-only: fix network unlock in check-only mode

Submitted by Adrian Reber on May 23, 2017, 9:42 a.m.

Details

Message ID 1495532535-22405-1-git-send-email-adrian@lisas.de
State New
Series "Series without cover letter"
Headers show

Commit Message

Adrian Reber May 23, 2017, 9:42 a.m.
Signed-off-by: Adrian Reber <areber@redhat.com>
---
 criu/cr-restore.c | 5 +++--
 criu/sk-tcp.c     | 5 +++++
 2 files changed, 8 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index 21ba39e..a4ef6a4 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -2207,8 +2207,9 @@  skip_ns_bouncing:
 	if (write_restored_pid())
 		goto out_kill;
 
-	/* Unlock network before disabling repair mode on sockets */
-	network_unlock();
+	if (!opts.check_only)
+		/* Unlock network before disabling repair mode on sockets */
+		network_unlock();
 
 	/*
 	 * Stop getting sigchld, after we resume the tasks they
diff --git a/criu/sk-tcp.c b/criu/sk-tcp.c
index 3acc710..66c553d 100644
--- a/criu/sk-tcp.c
+++ b/criu/sk-tcp.c
@@ -22,6 +22,7 @@ 
 #include "kerndat.h"
 #include "restorer.h"
 #include "rst-malloc.h"
+#include "cr_options.h"
 
 #include "protobuf.h"
 #include "images/tcp-stream.pb-c.h"
@@ -346,6 +347,9 @@  static int restore_tcp_conn_state(int sk, struct libsoccr_sk *socr, struct inet_
 	if (read_tcp_queues(socr, &data, img))
 		goto err_c;
 
+	if (opts.check_only)
+		goto skip_for_check;
+
 	if (libsoccr_restore(socr, &data, sizeof(data)))
 		goto err_c;
 
@@ -361,6 +365,7 @@  static int restore_tcp_conn_state(int sk, struct libsoccr_sk *socr, struct inet_
 			goto err_c;
 	}
 
+skip_for_check:
 	tcp_stream_entry__free_unpacked(tse, NULL);
 	close_image(img);
 	return 0;