}
/* FIXME Until resume ioctl supplies name, use dev_name for readahead */
- if (DEV_NAME(dmt) && (dmt->type != DM_DEVICE_RESUME || dmt->minor < 0 ||
- dmt->major < 0))
+ if (DEV_NAME(dmt) &&
+ (((dmt->type != DM_DEVICE_RESUME) &&
+ (dmt->type != DM_DEVICE_RELOAD)) ||
+ (dmt->minor < 0) || (dmt->major < 0)))
+ /* When RESUME or RELOAD sets maj:min and dev_name, use just maj:min,
+ * passed dev_name is useful for better error/debug messages */
strncpy(dmi->name, DEV_NAME(dmt), sizeof(dmi->name));
if (DEV_UUID(dmt))
log_verbose("device-mapper: %s ioctl on %s %s%s%.0d%s%.0d%s%s "
"failed: %s",
_cmd_data_v4[dmt->type].name,
- dmi->name, dmi->uuid,
+ dmi->name[0] ? dmi->name : DEV_NAME(dmt) ? : "",
+ dmi->uuid[0] ? dmi->uuid : DEV_UUID(dmt) ? : "",
dmt->major > 0 ? "(" : "",
dmt->major > 0 ? dmt->major : 0,
dmt->major > 0 ? ":" : "",
log_error("device-mapper: %s ioctl on %s %s%s%.0d%s%.0d%s%s "
"failed: %s",
_cmd_data_v4[dmt->type].name,
- dmi->name, dmi->uuid,
+ dmi->name[0] ? dmi->name : DEV_NAME(dmt) ? : "",
+ dmi->uuid[0] ? dmi->uuid : DEV_UUID(dmt) ? : "",
dmt->major > 0 ? "(" : "",
dmt->major > 0 ? dmt->major : 0,
dmt->major > 0 ? ":" : "",