From 05ff40b07a5857b41e17290e1d7cef516f122d6c Mon Sep 17 00:00:00 2001 From: shuai-z Date: Thu, 30 Oct 2014 13:31:19 +0800 Subject: [PATCH] Clear the internal state ourselves before raising error. If we need to raise an error, make sure the internal state is clean, because a successful driver.Get() may have its internal state changed (eg. counting, or mounts), while callers will only do that after a succussful Mount(). Signed-off-by: shuai-z --- daemon/daemon.go | 1 + 1 file changed, 1 insertion(+) diff --git a/daemon/daemon.go b/daemon/daemon.go index 658d578e4e..c19ebe9c65 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -970,6 +970,7 @@ func (daemon *Daemon) Mount(container *Container) error { if container.basefs == "" { container.basefs = dir } else if container.basefs != dir { + daemon.driver.Put(container.ID) return fmt.Errorf("Error: driver %s is returning inconsistent paths for container %s ('%s' then '%s')", daemon.driver, container.ID, container.basefs, dir) }