Skip to content

Commit

Permalink
Fix for issue #3786
Browse files Browse the repository at this point in the history
This is a fix for the case that one mount is inside another mount and
docker can't then delete the resulting container.

Docker-DCO-1.1-Signed-off-by: Peter Waller <p@pwaller.net> (github: pwaller)
  • Loading branch information
pwaller committed Jan 27, 2014
1 parent ffdc2d2 commit 32753c3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions container.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 32753c3

Please sign in to comment.