diff options
author | Sebastiaan van Stijn <thaJeztah@users.noreply.github.com> | 2022-03-05 21:18:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-05 21:18:26 +0100 |
commit | 367cd4193768964c873005e4b4b0d1e54868e6f8 (patch) | |
tree | a9aa1234bf2a7d0c9f3f132958b4c0f4e1e61514 /layer/migration.go | |
parent | 18e20d3f370507f371c28fda01737b9e4ed356e1 (diff) | |
parent | 203fcd69976fd36b06a59210eb15d5574b897aa3 (diff) | |
download | docker-367cd4193768964c873005e4b4b0d1e54868e6f8.tar.gz |
Merge pull request #43302 from thaJeztah/layer_remove_getwithoutlock
layers: remove layerStore.getWithoutLock()
Diffstat (limited to 'layer/migration.go')
-rw-r--r-- | layer/migration.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/layer/migration.go b/layer/migration.go index 3e6bd27cef..0d97c6eca2 100644 --- a/layer/migration.go +++ b/layer/migration.go @@ -87,7 +87,9 @@ func (ls *layerStore) RegisterByGraphID(graphID string, parent ChainID, diffID D var err error var p *roLayer if string(parent) != "" { + ls.layerL.Lock() p = ls.get(parent) + ls.layerL.Unlock() if p == nil { return nil, ErrLayerDoesNotExist } @@ -117,7 +119,7 @@ func (ls *layerStore) RegisterByGraphID(graphID string, parent ChainID, diffID D ls.layerL.Lock() defer ls.layerL.Unlock() - if existingLayer := ls.getWithoutLock(layer.chainID); existingLayer != nil { + if existingLayer := ls.get(layer.chainID); existingLayer != nil { // Set error for cleanup, but do not return err = errors.New("layer already exists") return existingLayer.getReference(), nil |