From fecd043cca4b5f4d5a244d715c60ce35ff1b62d7 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 14 Dec 2016 10:19:25 +0100 Subject: [PATCH] raid: split preserves local exlusive activation --- WHATS_NEW | 1 + lib/metadata/raid_manip.c | 19 ++----------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 60e8fa5e7..4ac33773b 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.169 - ===================================== + Always active splitted RAID LV exclusively locally. Do not use LV RAID status bit for segment status. Check segtype directly instead of checking RAID in segment status. Reusing exiting code for raid image removal. diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c index ed4823991..b48b9594a 100644 --- a/lib/metadata/raid_manip.c +++ b/lib/metadata/raid_manip.c @@ -163,22 +163,6 @@ uint32_t lv_raid_image_count(const struct logical_volume *lv) return seg->area_count; } -static int _activate_sublv_preserving_excl(struct logical_volume *top_lv, - struct logical_volume *sub_lv) -{ - struct cmd_context *cmd = top_lv->vg->cmd; - - /* If top RAID was EX, use EX */ - if (lv_is_active_exclusive_locally(top_lv)) { - if (!activate_lv_excl_local(cmd, sub_lv)) - return_0; - } else { - if (!activate_lv(cmd, sub_lv)) - return_0; - } - return 1; -} - /* HM Helper: prohibit allocation on @pv if @lv already has segments allocated on it */ static int _avoid_pv_of_lv(struct logical_volume *lv, struct physical_volume *pv) { @@ -1553,7 +1537,8 @@ int lv_raid_split_and_track(struct logical_volume *lv, display_lvname(lv)); /* Activate the split (and tracking) LV */ - if (!_activate_sublv_preserving_excl(lv, seg_lv(seg, s))) + /* Preserving exclusive local activation also for tracked LV */ + if (!activate_lv_excl_local(lv->vg->cmd, seg_lv(seg, s))) return_0; log_print_unless_silent("Use 'lvconvert --merge %s' to merge back into %s.", -- 2.43.5