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> Upstream-commit: 2c8b7c597ae43e28887a52a9fcb12273fe7d8797 Component: engine
This commit is contained in:
@ -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")
|
||||
|
||||
Reference in New Issue
Block a user