[lxc-devel] [lxc/master] commands: don't fail if unfreeze fails

brauner on Github lxc-bot at linuxcontainers.org
Thu Sep 17 09:14:26 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 524 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200917/8f7e23e1/attachment.bin>
-------------- next part --------------
From 586e8a8a57cdd0e665c9734fae685640751c063a Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Thu, 17 Sep 2020 11:11:44 +0200
Subject: [PATCH] commands: don't fail if unfreeze fails

We can e.g. fail the unfreeze because the freezer cgroup is not available and
then we erronously report that stopping the container failed.

Closes: #3471.
Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 src/lxc/commands.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/lxc/commands.c b/src/lxc/commands.c
index 4ed84c3a02..7245f7e2cb 100644
--- a/src/lxc/commands.c
+++ b/src/lxc/commands.c
@@ -895,11 +895,8 @@ static int lxc_cmd_stop_callback(int fd, struct lxc_cmd_req *req,
 			TRACE("Sent signal %d to pidfd %d", stopsignal, handler->pid);
 
 		rsp.ret = cgroup_ops->unfreeze(cgroup_ops, -1);
-		if (!rsp.ret)
-			return 0;
-
-		ERROR("Failed to unfreeze container \"%s\"", handler->name);
-		rsp.ret = -errno;
+		if (rsp.ret)
+			WARN("Failed to unfreeze container \"%s\"", handler->name);
 	} else {
 		rsp.ret = -errno;
 	}


More information about the lxc-devel mailing list