Browse code

Fix daemon panic on restoring containers

Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit c75de8e33cc0db5236eef6146f2de06533b46aa8)
Signed-off-by: Tibor Vass <tibor@docker.com>

Lei Jitang authored on 2016/07/27 11:51:03
Showing 1 changed files
... ...
@@ -563,6 +563,8 @@ func (clnt *client) Restore(containerID string, options ...CreateOption) error {
563 563
 		clnt.remote.Lock()
564 564
 		return nil
565 565
 	}
566
+	// relock because of the defer
567
+	clnt.remote.Lock()
566 568
 
567 569
 	clnt.deleteContainer(containerID)
568 570