Skip to content

Commit

Permalink
Merge pull request #1607 from mtrmac/overlay-put-failures
Browse files Browse the repository at this point in the history
Fail on unmount/rmdir in overlay.Driver.Put
  • Loading branch information
rhatdan authored May 25, 2023
2 parents b5bcd2a + da0df59 commit ff9ef3e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/overlay/overlay.go
Original file line number Diff line number Diff line change
Expand Up @@ -1778,11 +1778,13 @@ func (d *Driver) Put(id string) error {
if !unmounted {
if err := unix.Unmount(mountpoint, unix.MNT_DETACH); err != nil && !os.IsNotExist(err) {
logrus.Debugf("Failed to unmount %s overlay: %s - %v", id, mountpoint, err)
return fmt.Errorf("unmounting %q: %w", mountpoint, err)
}
}

if err := unix.Rmdir(mountpoint); err != nil && !os.IsNotExist(err) {
logrus.Debugf("Failed to remove mountpoint %s overlay: %s - %v", id, mountpoint, err)
return fmt.Errorf("removing mount point %q: %w", mountpoint, err)
}

return nil
Expand Down

0 comments on commit ff9ef3e

Please sign in to comment.