[criu-stable] memory/pid-reuse: allow no stats image to

Submitted by Pavel Tikhomirov on March 23, 2018, 9:09 a.m.

Details

Message ID 20180323090919.28875-1-ptikhomirov@virtuozzo.com
State New
Series "memory/pid-reuse: allow no stats image to"
Headers show

Commit Message

Pavel Tikhomirov March 23, 2018, 9:09 a.m.
https://jira.sw.ru/browse/PSBM-82806

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
 criu/mem.c   | 8 +-------
 criu/stats.c | 2 +-
 2 files changed, 2 insertions(+), 8 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/mem.c b/criu/mem.c
index 8d56b729a..a1876dfcd 100644
--- a/criu/mem.c
+++ b/criu/mem.c
@@ -313,13 +313,7 @@  static int detect_pid_reuse(struct pstree_item *item,
 			return -1;
 	}
 
-	if (!parent_se) {
-		pr_perror("No parent stats, for real error, please, " \
-			  "check warnings in get_parent_stats");
-		return -1;
-	}
-
-	if (parent_se->dump->has_dump_uptime) {
+	if (parent_se && parent_se->dump->has_dump_uptime) {
 		unsigned long long dump_ticks;
 
 		dump_ticks = parent_se->dump->dump_uptime/(USEC_PER_SEC/tps);
diff --git a/criu/stats.c b/criu/stats.c
index d344ad336..d80dac023 100644
--- a/criu/stats.c
+++ b/criu/stats.c
@@ -203,7 +203,7 @@  void write_stats(int what)
 	} else
 		return;
 
-	img = open_image_at(AT_FDCWD, CR_FD_STATS, O_DUMP, name);
+	img = open_image_at(get_service_fd(IMG_FD_OFF), CR_FD_STATS, O_DUMP, name);
 	if (img) {
 		pb_write_one(img, &stats, PB_STATS);
 		close_image(img);