[07/12] cr-dump: Warn if unmapping local memfd failed

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

Details

Message ID 20191109222045.89507-8-dima@arista.com
State Accepted
Series "compel: Add __must_check"
Commit 6a4609470b9f4e8778e74c0464d477417084610d
Headers show

Commit Message

Dmitry Safonov Nov. 9, 2019, 10:20 p.m.
Probably, not the worst that could happen, but still unexpected.
Preparing the ground to make compel_cure*() functions __must_check.

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

Patch hide | download patch | download mbox

diff --git a/criu/cr-dump.c b/criu/cr-dump.c
index d8cc4f915e43..6bdd28400d6b 100644
--- a/criu/cr-dump.c
+++ b/criu/cr-dump.c
@@ -1538,7 +1538,8 @@  static int cr_pre_dump_finish(int status)
 		timing_stop(TIME_MEMWRITE);
 
 		destroy_page_pipe(mem_pp);
-		compel_cure_local(ctl);
+		if (compel_cure_local(ctl))
+			pr_err("Can't cure local: something happened with mapping?\n");
 	}
 
 	free_pstree(root_item);
@@ -1670,7 +1671,8 @@  static int cr_lazy_mem_dump(void)
 	for_each_pstree_item(item) {
 		if (item->pid->state != TASK_DEAD) {
 			destroy_page_pipe(dmpi(item)->mem_pp);
-			compel_cure_local(dmpi(item)->parasite_ctl);
+			if (compel_cure_local(dmpi(item)->parasite_ctl))
+				pr_err("Can't cure local: something happened with mapping?\n");
 		}
 	}