[08/12] cr-restore: Warn if restorer can't be unmapped

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

Details

Message ID 20191109222045.89507-9-dima@arista.com
State Accepted
Series "compel: Add __must_check"
Commit 61cfd69f314bfcadea2a0d7a25d7bfbc480f07ec
Headers show

Commit Message

Dmitry Safonov Nov. 9, 2019, 10:20 p.m.
Too late to stop restore: it's already printed that restore was
successful. Oh, well warn aloud about infection.

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

Patch hide | download patch | download mbox

diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index de0b2cb407dd..41f78cb7a2f9 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -1953,6 +1953,7 @@  static void finalize_restore(void)
 	for_each_pstree_item(item) {
 		pid_t pid = item->pid->real;
 		struct parasite_ctl *ctl;
+		unsigned long restorer_addr;
 
 		if (!task_alive(item))
 			continue;
@@ -1962,7 +1963,9 @@  static void finalize_restore(void)
 		if (ctl == NULL)
 			continue;
 
-		compel_unmap(ctl, (unsigned long)rsti(item)->munmap_restorer);
+		restorer_addr = (unsigned long)rsti(item)->munmap_restorer;
+		if (compel_unmap(ctl, restorer_addr))
+			pr_err("Failed to unmap restorer from %d\n", pid);
 
 		xfree(ctl);