mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Cleanup mimagetmp LV if allocation fails for new lvconvert mimage.
This commit is contained in:
parent
cb63efc6f9
commit
a3a02a2f42
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.54 -
|
Version 2.02.54 -
|
||||||
=====================================
|
=====================================
|
||||||
|
Cleanup mimagetmp LV if allocation fails for new lvconvert mimage.
|
||||||
Fix clvmd segfault when refresh_toolcontext fails.
|
Fix clvmd segfault when refresh_toolcontext fails.
|
||||||
Remember to clear 'global lock held during cache refresh' state after use.
|
Remember to clear 'global lock held during cache refresh' state after use.
|
||||||
Use udev flags support in LVM.
|
Use udev flags support in LVM.
|
||||||
|
@ -532,7 +532,7 @@ static int _lvconvert_mirrors(struct cmd_context *cmd, struct logical_volume *lv
|
|||||||
const char *mirrorlog;
|
const char *mirrorlog;
|
||||||
unsigned corelog = 0;
|
unsigned corelog = 0;
|
||||||
int r = 0;
|
int r = 0;
|
||||||
struct logical_volume *log_lv;
|
struct logical_volume *log_lv, *layer_lv;
|
||||||
int failed_mirrors = 0, failed_log = 0;
|
int failed_mirrors = 0, failed_log = 0;
|
||||||
struct dm_list *old_pvh = NULL, *remove_pvs = NULL;
|
struct dm_list *old_pvh = NULL, *remove_pvs = NULL;
|
||||||
|
|
||||||
@ -733,8 +733,21 @@ static int _lvconvert_mirrors(struct cmd_context *cmd, struct logical_volume *lv
|
|||||||
lv->le_count,
|
lv->le_count,
|
||||||
lp->region_size),
|
lp->region_size),
|
||||||
0U, lp->pvh, lp->alloc,
|
0U, lp->pvh, lp->alloc,
|
||||||
MIRROR_BY_LV))
|
MIRROR_BY_LV)) {
|
||||||
|
layer_lv = seg_lv(first_seg(lv), 0);
|
||||||
|
if (!remove_layer_from_lv(lv, layer_lv) ||
|
||||||
|
!deactivate_lv(cmd, layer_lv) ||
|
||||||
|
!lv_remove(layer_lv) || !vg_write(lv->vg) ||
|
||||||
|
!vg_commit(lv->vg)) {
|
||||||
|
log_error("ABORTING: Failed to remove "
|
||||||
|
"temporary mirror layer %s.",
|
||||||
|
layer_lv->name);
|
||||||
|
log_error("Manual cleanup with vgcfgrestore "
|
||||||
|
"and dmsetup may be required.");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
return_0;
|
return_0;
|
||||||
|
}
|
||||||
lv->status |= CONVERTING;
|
lv->status |= CONVERTING;
|
||||||
lp->need_polling = 1;
|
lp->need_polling = 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user