diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index c41bcfd83..514973bbb 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.143 - ================================= + Accept minor number without major in library when it knows dm major number. Introduce single-line concise table output format: dmsetup table --concise Version 1.02.142 - 20th July 2017 diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c index c47e08467..e32af80ef 100644 --- a/libdm/ioctl/libdm-iface.c +++ b/libdm/ioctl/libdm-iface.c @@ -1172,11 +1172,6 @@ static struct dm_ioctl *_flatten(struct dm_task *dmt, unsigned repeat_count) dmi->data_start = sizeof(struct dm_ioctl); if (dmt->minor >= 0) { - if (dmt->major <= 0) { - log_error("Missing major number for persistent device."); - goto bad; - } - if (!_dm_multiple_major_support && dmt->allow_default_major_fallback && dmt->major != (int) _dm_device_major) { log_verbose("Overriding major number of %d " @@ -1185,6 +1180,11 @@ static struct dm_ioctl *_flatten(struct dm_task *dmt, unsigned repeat_count) dmt->major = _dm_device_major; } + if (dmt->major <= 0) { + log_error("Missing major number for persistent device."); + goto bad; + } + dmi->flags |= DM_PERSISTENT_DEV_FLAG; dmi->dev = MKDEV((dev_t)dmt->major, (dev_t)dmt->minor); }