Merge pull request #13325 from LK4D4/cleanup_mounts

Fix Put without Get in overlay
This commit is contained in:
Jessie Frazelle
2015-05-20 03:11:58 +02:00
2 changed files with 22 additions and 1 deletions
+8
View File
@@ -318,6 +318,14 @@ func (d *Driver) Put(id string) error {
mount := d.active[id]
if mount == nil {
logrus.Debugf("Put on a non-mounted device %s", id)
// but it might be still here
if d.Exists(id) {
mergedDir := path.Join(d.dir(id), "merged")
err := syscall.Unmount(mergedDir, 0)
if err != nil {
logrus.Debugf("Failed to unmount %s overlay: %v", id, err)
}
}
return nil
}