1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-17 06:04:23 +03:00

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.
This commit is contained in:
Zdenek Kabelac 2016-12-10 20:00:32 +01:00
parent 0c8369099b
commit 8831a541a8
2 changed files with 13 additions and 0 deletions

View File

@ -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.

View File

@ -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.