Skip to content

Commit

Permalink
volume/local: fix race in List
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Morozov <[email protected]>
  • Loading branch information
LK4D4 committed Mar 22, 2016
1 parent de9ff4b commit 3536c09
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions volume/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ type Root struct {
// List lists all the volumes
func (r *Root) List() ([]volume.Volume, error) {
var ls []volume.Volume
r.m.Lock()
for _, v := range r.volumes {
ls = append(ls, v)
}
r.m.Unlock()
return ls, nil
}

Expand Down

0 comments on commit 3536c09

Please sign in to comment.