From 201a37f7a110402a76ac1ee21b5d09ccffed2acb Mon Sep 17 00:00:00 2001 From: Fabio Kung Date: Mon, 27 Mar 2017 09:04:52 -0700 Subject: [PATCH] verifyVolumesInfo needs a container lock It operates on containers that have already been registered on the daemon, and are visible to other goroutines. Signed-off-by: Fabio Kung --- daemon/volumes_unix.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/daemon/volumes_unix.go b/daemon/volumes_unix.go index d91100f1c9..c01c573e93 100644 --- a/daemon/volumes_unix.go +++ b/daemon/volumes_unix.go @@ -137,6 +137,9 @@ func migrateVolume(id, vfs string) error { // verifyVolumesInfo ports volumes configured for the containers pre docker 1.7. // It reads the container configuration and creates valid mount points for the old volumes. func (daemon *Daemon) verifyVolumesInfo(container *container.Container) error { + container.Lock() + defer container.Unlock() + // Inspect old structures only when we're upgrading from old versions // to versions >= 1.7 and the MountPoints has not been populated with volumes data. type volumes struct {