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
d648832a2d
commit
c01a800a6b
@ -1,5 +1,6 @@
|
||||
Version 1.02.04 -
|
||||
============================
|
||||
If _create_and_load_v4 fails part way through, revert the creation.
|
||||
dmeventd thread/fifo fixes.
|
||||
Add file & line to dm_strdup_aux().
|
||||
Add setgeometry.
|
||||
|
@ -1383,7 +1383,7 @@ static int _create_and_load_v4(struct dm_task *dmt)
|
||||
task->tail = NULL;
|
||||
dm_task_destroy(task);
|
||||
if (!r)
|
||||
return r;
|
||||
goto revert;
|
||||
|
||||
/* Use the original structure last so the info will be correct */
|
||||
dmt->type = DM_DEVICE_RESUME;
|
||||
@ -1392,6 +1392,17 @@ static int _create_and_load_v4(struct dm_task *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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user