master - raid: fix activation order
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=62c7027a7c675dfef8f772b1e20ac18705b847a9 Commit: 62c7027a7c675dfef8f772b1e20ac18705b847a9 Parent: 32e4af6479689c4e25ecd273368d22136c93a75d Author: Zdenek Kabelac <[email protected]> AuthorDate: Mon Nov 10 22:04:44 2014 +0100 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Mon Nov 10 22:05:48 2014 +0100
raid: fix activation order
Cannot 'activate' volumes in suspend state and we need to use lock holding LV for suspend/resume.
--- lib/metadata/raid_manip.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-)
lib/metadata/raid_manip.c +7 -6
@@ -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