]> sourceware.org Git - lvm2.git/commitdiff
Revert unsuccessful table load preparation in combined "create, load and resume"...
authorPeter Rajnoha <prajnoha@redhat.com>
Wed, 28 Jul 2010 10:30:28 +0000 (10:30 +0000)
committerPeter Rajnoha <prajnoha@redhat.com>
Wed, 28 Jul 2010 10:30:28 +0000 (10:30 +0000)
There was missing "revert" call in _create_and_load_v4 fn while the preparation
for table load ends up with failure in create/load/resume sequence. Otherwise
we could end up with a device being created, but not table-loaded nor resumed.

Even though the table is not loaded and the device is not resumed at this
stage, we still need to synchronize with udev when calling the revert
"remove" ioctl - there's still a remove uevent generated! The "revert"
code does exactly that.

libdm/ioctl/libdm-iface.c

index 5f71098f098c0d45c1bececd4ce53163d6656fad..50cdec848fe6033e9c617a17e586f52d96f36220 100644 (file)
@@ -1655,14 +1655,16 @@ static int _create_and_load_v4(struct dm_task *dmt)
        if (!(task = dm_task_create(DM_DEVICE_RELOAD))) {
                log_error("Failed to create device-mapper task struct");
                _udev_complete(dmt);
-               return 0;
+               r = 0;
+               goto revert;
        }
 
        /* Copy across relevant fields */
        if (dmt->dev_name && !dm_task_set_name(task, dmt->dev_name)) {
                dm_task_destroy(task);
                _udev_complete(dmt);
-               return 0;
+               r = 0;
+               goto revert;
        }
 
        task->read_only = dmt->read_only;
This page took 0.034056 seconds and 5 git commands to generate.