Skip to content

Commit

Permalink
Merge pull request #1400 from mtrmac/fix-typos
Browse files Browse the repository at this point in the history
Fix locking bugs
  • Loading branch information
rhatdan authored Oct 19, 2022
2 parents fa02841 + 5c6186f commit 2ceb61c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion images.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func (r *imageStore) startWritingWithReload(canReload bool) error {
// startWriting makes sure the store is fresh, and locks it for writing.
// If this succeeds, the caller MUST call stopWriting().
func (r *imageStore) startWriting() error {
return r.startWritingWithReload(false)
return r.startWritingWithReload(true)
}

// stopWriting releases locks obtained by startWriting.
Expand Down
2 changes: 1 addition & 1 deletion layers.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ func (r *layerStore) startWritingWithReload(canReload bool) error {
// startWriting makes sure the store is fresh, and locks it for writing.
// If this succeeds, the caller MUST call stopWriting().
func (r *layerStore) startWriting() error {
return r.startWritingWithReload(false)
return r.startWritingWithReload(true)
}

// stopWriting releases locks obtained by startWriting.
Expand Down
2 changes: 1 addition & 1 deletion store.go
Original file line number Diff line number Diff line change
Expand Up @@ -1445,7 +1445,7 @@ func (s *store) CreateContainer(id string, names []string, image, layer, metadat
if err := store.startReading(); err != nil {
return nil, err
}
store.stopReading()
defer store.stopReading()
}
if err := istore.startWriting(); err != nil {
return nil, err
Expand Down

0 comments on commit 2ceb61c

Please sign in to comment.