Skip to content

Commit baff8a9

Browse files
rhvgoyalroot
authored andcommitted
BACKPORT: Use lazy umount on Put for overlay2 and overlay
Upstream commit: f65fa1f 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>
1 parent 638a809 commit baff8a9

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

daemon/graphdriver/overlay/overlay.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ func (d *Driver) Put(id string) error {
377377
if count := d.ctr.Decrement(mountpoint); count > 0 {
378378
return nil
379379
}
380-
if err := syscall.Unmount(mountpoint, 0); err != nil {
380+
if err := syscall.Unmount(mountpoint, syscall.MNT_DETACH); err != nil {
381381
logrus.Debugf("Failed to unmount %s overlay: %v", id, err)
382382
}
383383
return nil

daemon/graphdriver/overlay2/overlay.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ func (d *Driver) Put(id string) error {
440440
if count := d.ctr.Decrement(mountpoint); count > 0 {
441441
return nil
442442
}
443-
if err := syscall.Unmount(mountpoint, 0); err != nil {
443+
if err := syscall.Unmount(mountpoint, syscall.MNT_DETACH); err != nil {
444444
logrus.Debugf("Failed to unmount %s overlay: %v", id, err)
445445
}
446446
return nil

0 commit comments

Comments
 (0)