[lxc-devel] [lxd/master] Bugfixes

stgraber on Github lxc-bot at linuxcontainers.org
Thu Mar 31 21:02:34 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 301 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160331/f3fbbaf6/attachment.bin>
-------------- next part --------------
From 325f559e339444abefb74bbaea14d17531004c69 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 31 Mar 2016 17:01:04 -0400
Subject: [PATCH 1/2] Failure to unload the apparmor profile isn't fatal
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

If it was unloaded already somehow, then that's fine, if it can't be
unloaded, then keep it loaded and we'll just replace it on next startup.

Closes #1834

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/container_lxc.go | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/lxd/container_lxc.go b/lxd/container_lxc.go
index 8918160..a8e6037 100644
--- a/lxd/container_lxc.go
+++ b/lxd/container_lxc.go
@@ -1425,11 +1425,8 @@ func (c *containerLXC) OnStop(target string) error {
 		return err
 	}
 
-	// Unlock the apparmor profile
-	err = AAUnloadProfile(c)
-	if err != nil {
-		return err
-	}
+	// Unload the apparmor profile
+	AAUnloadProfile(c)
 
 	// FIXME: The go routine can go away once we can rely on LXC_TARGET
 	go func(c *containerLXC, target string, wg *sync.WaitGroup) {

From 3cb413d8df0ac8f2b6afa0aa880165b8ed7fcf00 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 31 Mar 2016 17:02:01 -0400
Subject: [PATCH 2/2] Prevent deadlock on container stop failure
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #1834

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/container_lxc.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lxd/container_lxc.go b/lxd/container_lxc.go
index a8e6037..9ad3a9c 100644
--- a/lxd/container_lxc.go
+++ b/lxd/container_lxc.go
@@ -1422,6 +1422,7 @@ func (c *containerLXC) OnStop(target string) error {
 	// Stop the storage for this container
 	err := c.StorageStop()
 	if err != nil {
+		wg.Done()
 		return err
 	}
 


More information about the lxc-devel mailing list