Ver Fonte

devmapper: Provide more error information if blkid fails

Right now if blkid fails we are just logging a debug message and don;t return
the actual error to caller. Caller gets the error message that thin pool
base device UUID verification failed and it might give impression that thin
pool changed. But that's not the case. Thin pool is in such a state that we
could not even query the thin device UUID. Retrun error message appropriately
to make situation more clear.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Vivek Goyal há 9 anos atrás
pai
commit
2c8b7c597a
1 ficheiros alterados com 1 adições e 2 exclusões
  1. 1 2
      daemon/graphdriver/devmapper/deviceset.go

+ 1 - 2
daemon/graphdriver/devmapper/deviceset.go

@@ -826,8 +826,7 @@ func (devices *DeviceSet) loadMetadata(hash string) *devInfo {
 func getDeviceUUID(device string) (string, error) {
 	out, err := exec.Command("blkid", "-s", "UUID", "-o", "value", device).Output()
 	if err != nil {
-		logrus.Debugf("Failed to find uuid for device %s:%v", device, err)
-		return "", err
+		return "", fmt.Errorf("Failed to find uuid for device %s:%v", device, err)
 	}
 
 	uuid := strings.TrimSuffix(string(out), "\n")