diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2016-12-10 20:00:32 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2016-12-11 23:18:22 +0100 |
commit | 8831a541a831a2d25cb96ee09f6739526d29e5c1 (patch) | |
tree | 19fbea825ea79e4717245fd8cd5a2e00cea7fdff | |
parent | 0c8369099bc6105f39982b3e36dd9a53c347b07a (diff) | |
download | lvm2-8831a541a831a2d25cb96ee09f6739526d29e5c1.tar.gz |
raid: fix delete on clustered vg
For clustered VG ensure lock is grabbed first,
so later deactivation works.
TODO: fix tree to solve device removal automatically.
-rw-r--r-- | WHATS_NEW | 1 | ||||
-rw-r--r-- | lib/metadata/raid_manip.c | 12 |
2 files changed, 13 insertions, 0 deletions
@@ -1,5 +1,6 @@ Version 2.02.169 - ===================================== + Fix deactivation of raid orphan devices for clustered VG. Fix lvconvert raid1 to mirror table reload order. Add internal function for separate mirror log preparation. Fix segfault in lvmetad from missing NULL in daemon_reply_simple. diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c index 5cbd8198a..661c39b4d 100644 --- a/lib/metadata/raid_manip.c +++ b/lib/metadata/raid_manip.c @@ -248,6 +248,12 @@ static int _deactivate_and_remove_lvs(struct volume_group *vg, struct dm_list *r { struct lv_list *lvl; + if (vg_is_clustered(vg)) + /* Need to take lock for proper deactivation */ + dm_list_iterate_items(lvl, removal_lvs) + if (!activate_lv_excl_local(vg->cmd, lvl->lv)) + return_0; + dm_list_iterate_items(lvl, removal_lvs) { if (!deactivate_lv(vg->cmd, lvl->lv)) return_0; @@ -2968,6 +2974,12 @@ static int _clear_meta_lvs(struct logical_volume *lv) !lv_update_and_reload(lv)) return_0; + /* Note: detached rmeta are NOT renamed */ + /* Grab locks first in case of clustered VG */ + if (vg_is_clustered(lv->vg)) + dm_list_iterate_items(lvl, &meta_lvs) + if (!activate_lv_excl_local(lv->vg->cmd, lvl->lv)) + return_0; /* * Now deactivate the MetaLVs before clearing, so * that _clear_lvs() will activate them visible. |