From e6a73e65a23163273fa63d54b8f12530f7eef104 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 17 Oct 2013 09:53:09 +0200 Subject: [PATCH] devicemapper: Use device/inode of the root dir, not the image This way the devicemapper prefix stays stable even if we're not using loopback mounted devices. --- devmapper/deviceset_devmapper.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/devmapper/deviceset_devmapper.go b/devmapper/deviceset_devmapper.go index 309a26db79..aa7090e284 100644 --- a/devmapper/deviceset_devmapper.go +++ b/devmapper/deviceset_devmapper.go @@ -361,11 +361,11 @@ func (devices *DeviceSetDM) initDevmapper() error { return err } - // Set the device prefix from the device id and inode of the data image + // Set the device prefix from the device id and inode of the docker root dir - st, err := os.Stat(data) + st, err := os.Stat(devices.root) if err != nil { - return fmt.Errorf("Error looking up data image %s: %s", data, err) + return fmt.Errorf("Error looking up dir %s: %s", devices.root, err) } sysSt := st.Sys().(*syscall.Stat_t) // "reg-" stands for "regular file".