From 0822d903642e02c44b086e6856a30f80887412ee Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Fri, 9 Jun 2017 18:25:05 -0400 Subject: [PATCH] Do not calculate size for local volumes with mount Local volumes support mount options which, when in use, can mount external file systems. We don't really need to enumerate these external filesystems which may be a very slow process. Signed-off-by: Brian Goff --- daemon/disk_usage.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/daemon/disk_usage.go b/daemon/disk_usage.go index 83de00ab2e..fb15c3c373 100644 --- a/daemon/disk_usage.go +++ b/daemon/disk_usage.go @@ -65,6 +65,13 @@ func (daemon *Daemon) SystemDiskUsage(ctx context.Context) (*types.DiskUsage, er case <-ctx.Done(): return ctx.Err() default: + if d, ok := v.(volume.DetailedVolume); ok { + // skip local volumes with mount options since these could have external + // mounted filesystems that will be slow to enumerate. + if len(d.Options()) > 0 { + return nil + } + } name := v.Name() refs := daemon.volumes.Refs(v)