From 93e08ea089e8ede9d53a3d345ea4384b08e86ee2 Mon Sep 17 00:00:00 2001 From: John Floren Date: Mon, 5 Aug 2019 14:01:19 -0600 Subject: [PATCH] Fixes a problem when using Docker on a host with an encrypted LLVM root. A docker container with a volume mounted from the host will see /dev/mapper in its mount info file, but will not be able to read it. --- disk/disk_linux.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/disk/disk_linux.go b/disk/disk_linux.go index 0bf5ed5..58acb36 100644 --- a/disk/disk_linux.go +++ b/disk/disk_linux.go @@ -302,10 +302,9 @@ func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, erro if strings.HasPrefix(d.Device, "/dev/mapper/") { devpath, err := filepath.EvalSymlinks(d.Device) - if err != nil { - return nil, err + if err == nil { + d.Device = devpath } - d.Device = devpath } // /dev/root is not the real device name