Merge pull request #1730 from dmcgowan/fix-usage-deadlock

Fix deadlock in overlay snapshotter
This commit is contained in:
Phil Estes 2017-11-08 13:34:42 -05:00 committed by GitHub
commit 4701e122fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,12 +124,13 @@ func (o *snapshotter) Usage(ctx context.Context, key string) (snapshot.Usage, er
return snapshot.Usage{}, err return snapshot.Usage{}, err
} }
id, info, usage, err := storage.GetInfo(ctx, key) id, info, usage, err := storage.GetInfo(ctx, key)
t.Rollback() // transaction no longer needed at this point.
if err != nil { if err != nil {
return snapshot.Usage{}, err return snapshot.Usage{}, err
} }
upperPath := o.upperPath(id) upperPath := o.upperPath(id)
t.Rollback() // transaction no longer needed at this point.
if info.Kind == snapshot.KindActive { if info.Kind == snapshot.KindActive {
du, err := fs.DiskUsage(upperPath) du, err := fs.DiskUsage(upperPath)