mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
daemon.cleanupContainer: nullify container RWLayer upon release
ReleaseRWLayer can and should only be called once (unless it returns an error), but might be called twice in case of a failure from `system.EnsureRemoveAll(container.Root)`. This results in the following error: > Error response from daemon: driver "XXX" failed to remove root filesystem for YYY: layer not retained The obvious fix is to set container.RWLayer to nil as soon as ReleaseRWLayer() succeeds. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -128,6 +128,7 @@ func (daemon *Daemon) cleanupContainer(container *container.Container, forceRemo
|
||||
container.SetRemovalError(e)
|
||||
return e
|
||||
}
|
||||
container.RWLayer = nil
|
||||
}
|
||||
|
||||
if err := system.EnsureRemoveAll(container.Root); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user