Merge pull request #3787 from pwaller/issue-3786

Fix for issue #3786 `docker rm` unmounts in the wrong order
Upstream-commit: 77d4df1e0bc42105a1cd6dbe7fb98e26d0027510
Component: engine
This commit is contained in:
Guillaume J. Charmes
2014-01-27 13:41:14 -08:00
+3 -3
View File
@@ -1365,9 +1365,9 @@ func (container *Container) Unmount() error {
mounts = append(mounts, path.Join(root, r))
}
for _, m := range mounts {
if lastError := mount.Unmount(m); lastError != nil {
err = lastError
for i := len(mounts) - 1; i >= 0; i-- {
if lastError := mount.Unmount(mounts[i]); lastError != nil {
err = fmt.Errorf("Failed to umount %v: %v", mounts[i], lastError)
}
}
if err != nil {