mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-11 20:58:50 +03:00
thin: fix error path in creation path
Remove some calls to revert_new_lv when no LV has been created/commited so far. When the pool update failed - then only revert is needed.
This commit is contained in:
parent
1d3f7953bd
commit
7afa9cebcb
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.99 -
|
Version 2.02.99 -
|
||||||
===================================
|
===================================
|
||||||
|
Correct thin creation error paths.
|
||||||
Use local activation for clearing snapshot COW device.
|
Use local activation for clearing snapshot COW device.
|
||||||
Add lvm2-activation-net systemd unit to activate LVs on net-attached storage.
|
Add lvm2-activation-net systemd unit to activate LVs on net-attached storage.
|
||||||
Release memory allocated with _cached_info().
|
Release memory allocated with _cached_info().
|
||||||
|
@ -5646,10 +5646,8 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l
|
|||||||
} else if (seg_is_thin_volume(lp)) {
|
} else if (seg_is_thin_volume(lp)) {
|
||||||
pool_lv = first_seg(lv)->pool_lv;
|
pool_lv = first_seg(lv)->pool_lv;
|
||||||
if (!(first_seg(lv)->device_id =
|
if (!(first_seg(lv)->device_id =
|
||||||
get_free_pool_device_id(first_seg(pool_lv)))) {
|
get_free_pool_device_id(first_seg(pool_lv))))
|
||||||
stack;
|
return_NULL;
|
||||||
goto revert_new_lv;
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* Check if using 'external origin' or the 'normal' snapshot
|
* Check if using 'external origin' or the 'normal' snapshot
|
||||||
* within the same thin pool
|
* within the same thin pool
|
||||||
@ -5663,17 +5661,13 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l
|
|||||||
log_error("Cannot use active LV for the external origin.");
|
log_error("Cannot use active LV for the external origin.");
|
||||||
return 0; // We can't be sure device is read-only
|
return 0; // We can't be sure device is read-only
|
||||||
}
|
}
|
||||||
if (!attach_thin_external_origin(first_seg(lv), org)) {
|
if (!attach_thin_external_origin(first_seg(lv), org))
|
||||||
stack;
|
return_NULL;
|
||||||
goto revert_new_lv;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!attach_pool_message(first_seg(pool_lv),
|
if (!attach_pool_message(first_seg(pool_lv),
|
||||||
DM_THIN_MESSAGE_CREATE_THIN, lv, 0, 0)) {
|
DM_THIN_MESSAGE_CREATE_THIN, lv, 0, 0))
|
||||||
stack;
|
return_NULL;
|
||||||
goto revert_new_lv;
|
|
||||||
}
|
|
||||||
} else if (seg_is_raid(lp)) {
|
} else if (seg_is_raid(lp)) {
|
||||||
first_seg(lv)->min_recovery_rate = lp->min_recovery_rate;
|
first_seg(lv)->min_recovery_rate = lp->min_recovery_rate;
|
||||||
first_seg(lv)->max_recovery_rate = lp->max_recovery_rate;
|
first_seg(lv)->max_recovery_rate = lp->max_recovery_rate;
|
||||||
@ -5734,7 +5728,7 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l
|
|||||||
/* At this point remove pool messages, snapshot is active */
|
/* At this point remove pool messages, snapshot is active */
|
||||||
if (!update_pool_lv(first_seg(org)->pool_lv, 0)) {
|
if (!update_pool_lv(first_seg(org)->pool_lv, 0)) {
|
||||||
stack;
|
stack;
|
||||||
goto deactivate_and_revert_new_lv;
|
goto revert_new_lv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((lp->activate != CHANGE_AN) && (lp->activate != CHANGE_ALN)) {
|
if ((lp->activate != CHANGE_AN) && (lp->activate != CHANGE_ALN)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user