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>
| ... | ... |
@@ -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 |
} |