1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

raid: query lock holder

Ask for lock the proper LV.
Use the top-most LV to query for locally exclusive lock.

The rest of operations are then using 'lv_info()'

TODO:
  Check all devices are reloaded from proper level.
  In general any query on lv_is_active is supposed to be running
  ona lv_lock_holder() volume.
This commit is contained in:
Zdenek Kabelac 2014-10-21 10:53:56 +02:00
parent e901a87a69
commit 1c7aae40a1
3 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.112 -
=====================================
Query lock holding LV when replacing and converting raid volumes.
Add extra validate for locked lv within validate_lv_cache_create().
Add internal lvseg_name() function.
Skip trying to file lock virtual internal vg name.

View File

@ -1555,7 +1555,7 @@ int lv_raid_replace(struct logical_volume *lv,
if (lv->status & PARTIAL_LV)
lv->vg->cmd->partial_activation = 1;
if (!lv_is_active_exclusive_locally(lv)) {
if (!lv_is_active_exclusive_locally(lv_lock_holder(lv))) {
log_error("%s/%s must be active %sto perform this operation.",
lv->vg->name, lv->name,
vg_is_clustered(lv->vg) ? "exclusive locally " : "");

View File

@ -1902,7 +1902,7 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
return lv_raid_replace(lv, lp->replace_pvh, lp->pvh);
if (arg_count(cmd, repair_ARG)) {
if (!lv_is_active_exclusive_locally(lv)) {
if (!lv_is_active_exclusive_locally(lv_lock_holder(lv))) {
log_error("%s/%s must be active %sto perform this"
" operation.", lv->vg->name, lv->name,
vg_is_clustered(lv->vg) ?