mirror of
https://github.com/moby/moby.git
synced 2026-08-03 06:30:59 +00:00
Use lazy umount on Put for overlay2 and overlay
we see a lot of ``` level=debug msg="Failed to unmount a03b1bb6f569421857e5407d73d89451f92724674caa56bfc2170de7e585a00b-init overlay: device or resource busy" ``` in daemon logs and there is a lot of mountpoint leftover. This cause failed to remove container. Signed-off-by: Lei Jitang <leijitang@huawei.com>
This commit is contained in:
@@ -404,7 +404,7 @@ func (d *Driver) Put(id string) error {
|
||||
if count := d.ctr.Decrement(mountpoint); count > 0 {
|
||||
return nil
|
||||
}
|
||||
if err := syscall.Unmount(mountpoint, 0); err != nil {
|
||||
if err := syscall.Unmount(mountpoint, syscall.MNT_DETACH); err != nil {
|
||||
logrus.Debugf("Failed to unmount %s overlay: %v", id, err)
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -587,7 +587,7 @@ func (d *Driver) Put(id string) error {
|
||||
if count := d.ctr.Decrement(mountpoint); count > 0 {
|
||||
return nil
|
||||
}
|
||||
if err := syscall.Unmount(mountpoint, 0); err != nil {
|
||||
if err := syscall.Unmount(mountpoint, syscall.MNT_DETACH); err != nil {
|
||||
logrus.Debugf("Failed to unmount %s overlay: %s - %v", id, mountpoint, err)
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user