mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-22 17:35:59 +03:00
If _create_and_load_v4 fails part way through, revert the creation.
This commit is contained in:
parent
a31676722b
commit
73f378f226
@ -1,5 +1,6 @@
|
|||||||
Version 1.02.04 -
|
Version 1.02.04 -
|
||||||
============================
|
============================
|
||||||
|
If _create_and_load_v4 fails part way through, revert the creation.
|
||||||
dmeventd thread/fifo fixes.
|
dmeventd thread/fifo fixes.
|
||||||
Add file & line to dm_strdup_aux().
|
Add file & line to dm_strdup_aux().
|
||||||
Add setgeometry.
|
Add setgeometry.
|
||||||
|
@ -1383,7 +1383,7 @@ static int _create_and_load_v4(struct dm_task *dmt)
|
|||||||
task->tail = NULL;
|
task->tail = NULL;
|
||||||
dm_task_destroy(task);
|
dm_task_destroy(task);
|
||||||
if (!r)
|
if (!r)
|
||||||
return r;
|
goto revert;
|
||||||
|
|
||||||
/* Use the original structure last so the info will be correct */
|
/* Use the original structure last so the info will be correct */
|
||||||
dmt->type = DM_DEVICE_RESUME;
|
dmt->type = DM_DEVICE_RESUME;
|
||||||
@ -1392,6 +1392,17 @@ static int _create_and_load_v4(struct dm_task *dmt)
|
|||||||
|
|
||||||
r = dm_task_run(dmt);
|
r = dm_task_run(dmt);
|
||||||
|
|
||||||
|
if (r)
|
||||||
|
return r;
|
||||||
|
|
||||||
|
revert:
|
||||||
|
dmt->type = DM_DEVICE_REMOVE;
|
||||||
|
dm_free(dmt->uuid);
|
||||||
|
dmt->uuid = NULL;
|
||||||
|
|
||||||
|
if (!dm_task_run(dmt))
|
||||||
|
log_error("Failed to revert device creation.");
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user