1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-18 10:04:20 +03:00

cleanup: move detection of change mode before commit point

Following patch will need to know change state before commit point.
Also the test mode should properly report all ongoing operation.
This commit is contained in:
Zdenek Kabelac 2013-07-18 16:25:16 +02:00
parent 20187fc190
commit e8fc77bd6d

View File

@ -5685,13 +5685,6 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l
lv_set_activation_skip(lv, lp->activation_skip & ACTIVATION_SKIP_SET, lv_set_activation_skip(lv, lp->activation_skip & ACTIVATION_SKIP_SET,
lp->activation_skip & ACTIVATION_SKIP_SET_ENABLED); lp->activation_skip & ACTIVATION_SKIP_SET_ENABLED);
/* store vg on disk(s) */
if (!vg_write(vg) || !vg_commit(vg))
return_NULL;
backup(vg);
/* /*
* Check for autoactivation. * Check for autoactivation.
* If the LV passes the auto activation filter, activate * If the LV passes the auto activation filter, activate
@ -5701,17 +5694,23 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l
lp->activate = lv_passes_auto_activation_filter(cmd, lv) ? lp->activate = lv_passes_auto_activation_filter(cmd, lv) ?
CHANGE_ALY : CHANGE_ALN; CHANGE_ALY : CHANGE_ALN;
if (test_mode()) {
log_verbose("Test mode: Skipping activation and zeroing.");
goto out;
}
if (lv_activation_skip(lv, lp->activate, lp->activation_skip & ACTIVATION_SKIP_IGNORE, 0)) { if (lv_activation_skip(lv, lp->activate, lp->activation_skip & ACTIVATION_SKIP_IGNORE, 0)) {
log_verbose("ACTIVATION_SKIP flag set for LV %s/%s, skipping activation.", log_verbose("ACTIVATION_SKIP flag set for LV %s/%s, skipping activation.",
lv->vg->name, lv->name); lv->vg->name, lv->name);
lp->activate = CHANGE_AN; lp->activate = CHANGE_AN;
} }
/* store vg on disk(s) */
if (!vg_write(vg) || !vg_commit(vg))
return_NULL;
backup(vg);
if (test_mode()) {
log_verbose("Test mode: Skipping activation and zeroing.");
goto out;
}
if (seg_is_thin(lp)) { if (seg_is_thin(lp)) {
/* For snapshot, suspend active thin origin first */ /* For snapshot, suspend active thin origin first */
if (org && lv_is_active(org) && lv_is_thin_volume(org)) { if (org && lv_is_active(org) && lv_is_thin_volume(org)) {