From 899f1b18707d035a1dca73cae0dd7b3bfe65c046 Mon Sep 17 00:00:00 2001 From: Lei Jitang Date: Tue, 26 Jan 2016 20:20:30 -0500 Subject: [PATCH] Daemon: do GetRWLayer after checking if container use the current graph driver Signed-off-by: Lei Jitang --- daemon/daemon.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/daemon/daemon.go b/daemon/daemon.go index 8af07f38c6..60de2ab950 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -277,15 +277,14 @@ func (daemon *Daemon) restore() error { continue } - rwlayer, err := daemon.layerStore.GetRWLayer(container.ID) - if err != nil { - logrus.Errorf("Failed to load container mount %v: %v", id, err) - continue - } - container.RWLayer = rwlayer - // Ignore the container if it does not support the current driver being used by the graph if (container.Driver == "" && currentDriver == "aufs") || container.Driver == currentDriver { + rwlayer, err := daemon.layerStore.GetRWLayer(container.ID) + if err != nil { + logrus.Errorf("Failed to load container mount %v: %v", id, err) + continue + } + container.RWLayer = rwlayer logrus.Debugf("Loaded container %v", container.ID) containers[container.ID] = container