diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2019-12-10 13:28:44 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2019-12-10 15:42:59 +0100 |
commit | 4353823306800fda4184a4a4278d036ca345993b (patch) | |
tree | 59e63b6595f3b359c2054e26fb3434b21376d95b /libdm/ioctl | |
parent | df0bc5081c1b84c2ae7c8d8dc92305f90f161683 (diff) | |
download | lvm2-4353823306800fda4184a4a4278d036ca345993b.tar.gz |
libdm: set maj:min while creating and reloading device
Add maj:min to the task structure for RELOAD - which is now
handled in _flatten() and will just skip passing device name.
Diffstat (limited to 'libdm/ioctl')
-rw-r--r-- | libdm/ioctl/libdm-iface.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c index ae44abfc9..7ad549c91 100644 --- a/libdm/ioctl/libdm-iface.c +++ b/libdm/ioctl/libdm-iface.c @@ -1429,6 +1429,7 @@ static int _check_uevent_generated(struct dm_ioctl *dmi) static int _create_and_load_v4(struct dm_task *dmt) { + struct dm_info info; struct dm_task *task; int r; uint32_t cookie; @@ -1459,6 +1460,9 @@ static int _create_and_load_v4(struct dm_task *dmt) if (!dm_task_run(task)) goto_bad; + if (!dm_task_get_info(task, &info) || !info.exists) + goto_bad; + dm_task_destroy(task); /* Next load the table */ @@ -1476,6 +1480,8 @@ static int _create_and_load_v4(struct dm_task *dmt) goto revert; } + task->major = info.major; + task->minor = info.minor; task->read_only = dmt->read_only; task->head = dmt->head; task->tail = dmt->tail; |