[Devel] dump: any non-negative return code of run_scripts means an error

Submitted by Andrei Vagin on April 6, 2017, 7:46 p.m.

Details

Message ID 1491507966-26008-1-git-send-email-avagin@openvz.org
State New
Series "dump: any non-negative return code of run_scripts means an error"
Headers show

Commit Message

Andrei Vagin April 6, 2017, 7:46 p.m.
From: Andrei Vagin <avagin@virtuozzo.com>

run_scripts can execute notifications via rpc, so WEXITSTATUS()
can't be applied to return codes in this case.

And an action script can be killed and it is an error too.

This patch may fix on of errors of
https://jira.sw.ru/browse/PSBM-62583

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
---
 criu/cr-dump.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/cr-dump.c b/criu/cr-dump.c
index e0d66aa..6998988 100644
--- a/criu/cr-dump.c
+++ b/criu/cr-dump.c
@@ -1877,10 +1877,8 @@  static int cr_dump_finish(int ret)
 		 * checkpoint.
 		 */
 		post_dump_ret = run_scripts(ACT_POST_DUMP);
-		if (post_dump_ret) {
-			post_dump_ret = WEXITSTATUS(post_dump_ret);
-			pr_info("Post dump script passed with %d\n", post_dump_ret);
-		}
+		if (post_dump_ret)
+			pr_err("Post dump script passed with %d\n", post_dump_ret);
 	}
 
 	/*

Comments

Kirill Gorkunov April 6, 2017, 7:51 p.m.
On Thu, Apr 06, 2017 at 12:46:06PM -0700, Andrey Vagin wrote:
> From: Andrei Vagin <avagin@virtuozzo.com>
> 
> run_scripts can execute notifications via rpc, so WEXITSTATUS()
> can't be applied to return codes in this case.
Pushed into 2.10.0.36. Thanks!