Browse Source

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 <zs.broccoli@gmail.com>
shuai-z 10 years ago
parent
commit
05ff40b07a
1 changed files with 1 additions and 0 deletions
  1. 1 0
      daemon/daemon.go

+ 1 - 0
daemon/daemon.go

@@ -970,6 +970,7 @@ func (daemon *Daemon) Mount(container *Container) error {
 	if container.basefs == "" {
 	if container.basefs == "" {
 		container.basefs = dir
 		container.basefs = dir
 	} else if 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')",
 		return fmt.Errorf("Error: driver %s is returning inconsistent paths for container %s ('%s' then '%s')",
 			daemon.driver, container.ID, container.basefs, dir)
 			daemon.driver, container.ID, container.basefs, dir)
 	}
 	}