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>
This commit is contained in:
parent
74564e51ad
commit
05ff40b07a
1 changed files with 1 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue