[06/12] cr-dump: Try to cure remote on err-pathes

Submitted by Dmitry Safonov on Nov. 9, 2019, 10:20 p.m.

Details

Message ID 20191109222045.89507-7-dima@arista.com
State Accepted
Series "compel: Add __must_check"
Commit 1499b0de59b9097e14da2588bb3f544535eefa1d
Headers show

Commit Message

Dmitry Safonov Nov. 9, 2019, 10:20 p.m.
On daemon stop or threads dump failures it's still desired to remove
parasite from the remote (if possible). Try best and keep hopeing.

Signed-off-by: Dmitry Safonov <dima@arista.com>
---
 criu/cr-dump.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/cr-dump.c b/criu/cr-dump.c
index 8aabb85b11b0..d8cc4f915e43 100644
--- a/criu/cr-dump.c
+++ b/criu/cr-dump.c
@@ -1386,16 +1386,20 @@  static int dump_one_task(struct pstree_item *item, InventoryEntry *parent_ie)
 
 	ret = compel_stop_daemon(parasite_ctl);
 	if (ret) {
-		pr_err("Can't cure (pid: %d) from parasite\n", pid);
-		goto err;
+		pr_err("Can't stop daemon in parasite (pid: %d)\n", pid);
+		goto err_cure;
 	}
 
 	ret = dump_task_threads(parasite_ctl, item);
 	if (ret) {
 		pr_err("Can't dump threads\n");
-		goto err;
+		goto err_cure;
 	}
 
+	/*
+	 * On failure local map will be cured in cr_dump_finish()
+	 * for lazy pages.
+	 */
 	if (opts.lazy_pages)
 		ret = compel_cure_remote(parasite_ctl);
 	else
@@ -1428,7 +1432,9 @@  err:
 err_cure:
 	close_cr_imgset(&cr_imgset);
 err_cure_imgset:
-	compel_cure(parasite_ctl);
+	ret = compel_cure(parasite_ctl);
+	if (ret)
+		pr_err("Can't cure (pid: %d) from parasite\n", pid);
 	goto err;
 }