1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

raid: fix activation order

Cannot 'activate' volumes in suspend state and we need to use
lock holding LV for suspend/resume.
This commit is contained in:
Zdenek Kabelac 2014-11-10 22:04:44 +01:00
parent 32e4af6479
commit 62c7027a7c

View File

@ -1136,7 +1136,7 @@ int lv_raid_split(struct logical_volume *lv, const char *split_name,
return 0;
}
if (!suspend_lv(cmd, lv)) {
if (!suspend_lv(cmd, lv_lock_holder(lv))) {
log_error("Failed to suspend %s/%s before committing changes",
lv->vg->name, lv->name);
vg_revert(lv->vg);
@ -1149,6 +1149,12 @@ int lv_raid_split(struct logical_volume *lv, const char *split_name,
return 0;
}
if (!resume_lv(lv->vg->cmd, lv_lock_holder(lv))) {
log_error("Failed to resume %s/%s after committing changes",
lv->vg->name, lv->name);
return 0;
}
/*
* First activate the newly split LV and LVs on the removal list.
* This is necessary so that there are no name collisions due to
@ -1162,11 +1168,6 @@ int lv_raid_split(struct logical_volume *lv, const char *split_name,
if (!activate_lv_excl_local(cmd, lvl->lv))
return_0;
if (!resume_lv(lv->vg->cmd, lv)) {
log_error("Failed to resume %s/%s after committing changes",
lv->vg->name, lv->name);
return 0;
}
/*
* Eliminate the residual LVs