mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #9625 from LK4D4/fix_race_in_sec_opts
Fix race condition between parseSecurityOpt and container.Mount
This commit is contained in:
commit
b66abaa291
1 changed files with 4 additions and 2 deletions
|
@ -44,6 +44,8 @@ func (daemon *Daemon) ContainerStart(job *engine.Job) engine.Status {
|
|||
}
|
||||
|
||||
func (daemon *Daemon) setHostConfig(container *Container, hostConfig *runconfig.HostConfig) error {
|
||||
container.Lock()
|
||||
defer container.Unlock()
|
||||
if err := parseSecurityOpt(container, hostConfig); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -66,8 +68,8 @@ func (daemon *Daemon) setHostConfig(container *Container, hostConfig *runconfig.
|
|||
if err := daemon.RegisterLinks(container, hostConfig); err != nil {
|
||||
return err
|
||||
}
|
||||
container.SetHostConfig(hostConfig)
|
||||
container.ToDisk()
|
||||
container.hostConfig = hostConfig
|
||||
container.toDisk()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue