Browse code

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 authored on 2014/10/30 14:31:19
Showing 1 changed files
... ...
@@ -970,6 +970,7 @@ func (daemon *Daemon) Mount(container *Container) error {
970 970
 	if container.basefs == "" {
971 971
 		container.basefs = dir
972 972
 	} else if container.basefs != dir {
973
+		daemon.driver.Put(container.ID)
973 974
 		return fmt.Errorf("Error: driver %s is returning inconsistent paths for container %s ('%s' then '%s')",
974 975
 			daemon.driver, container.ID, container.basefs, dir)
975 976
 	}