summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2016-12-14 10:19:25 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2016-12-14 11:40:01 +0100
commitfecd043cca4b5f4d5a244d715c60ce35ff1b62d7 (patch)
tree5a220239477ac02b88e51fb3c5ba2247be00f96c
parent77e09c3fb4d019ab3a0472059481ef990c64b415 (diff)
downloadlvm2-fecd043cca4b5f4d5a244d715c60ce35ff1b62d7.tar.gz
raid: split preserves local exlusive activation
-rw-r--r--WHATS_NEW1
-rw-r--r--lib/metadata/raid_manip.c19
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.",