mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix overlay unmount for the root case
In root case no mount call or reference count increment actually happens so don’t try to unmount. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
parent
844a3166e5
commit
e4349ad901
1 changed files with 4 additions and 0 deletions
|
@ -374,6 +374,10 @@ func (d *Driver) Get(id string, mountLabel string) (s string, err error) {
|
|||
|
||||
// Put unmounts the mount path created for the give id.
|
||||
func (d *Driver) Put(id string) error {
|
||||
// If id has a root, just return
|
||||
if _, err := os.Stat(path.Join(d.dir(id), "root")); err == nil {
|
||||
return nil
|
||||
}
|
||||
mountpoint := path.Join(d.dir(id), "merged")
|
||||
if count := d.ctr.Decrement(mountpoint); count > 0 {
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue