From c46db363d67c86e8887eec5be521134ae4e31f4c Mon Sep 17 00:00:00 2001 From: Lei Jitang Date: Tue, 26 Jul 2016 22:51:03 -0400 Subject: [PATCH] Fix daemon panic on restoring containers Signed-off-by: Lei Jitang (cherry picked from commit c75de8e33cc0db5236eef6146f2de06533b46aa8) Signed-off-by: Tibor Vass --- libcontainerd/client_linux.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libcontainerd/client_linux.go b/libcontainerd/client_linux.go index d2d91f2596..afb68b4a45 100644 --- a/libcontainerd/client_linux.go +++ b/libcontainerd/client_linux.go @@ -563,6 +563,8 @@ func (clnt *client) Restore(containerID string, options ...CreateOption) error { clnt.remote.Lock() return nil } + // relock because of the defer + clnt.remote.Lock() clnt.deleteContainer(containerID)