1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

report: display 'unknown' value for lv_active_remotely field if the LV is also active locally

Currently, we can't determine whether the LV is active remotely
or not in that case.
This commit is contained in:
Peter Rajnoha 2014-07-11 11:56:50 +02:00
parent c9ae21798e
commit fd5912762b

View File

@ -1478,7 +1478,28 @@ static int _lvactiveremotely_disp(struct dm_report *rh, struct dm_pool *mem,
if (vg_is_clustered(lv->vg)) {
lv = lv_lock_holder(lv);
active_remotely = lv_is_active_but_not_locally(lv);
/* FIXME: It seems we have no way to get this info correctly
* with current interface - we'd need to check number
* of responses from the cluster:
* - if number of nodes that responded == 1
* - and LV is active on local node
* ..then we may say that LV is *not* active remotely.
*
* Otherwise ((responses > 1 && LV active locally) ||
* (responses == 1 && LV not active locally)), it's
* active remotely.
*
* We have this info, but hidden underneath the
* locking interface (locking_type.query_resource fn).
*
* For now, let's use 'unknown' for remote status if
* the LV is found active locally until we find a way to
* smuggle the proper information out of the interface.
*/
if (lv_is_active_locally(lv))
return _binary_undef_disp(rh, mem, field, private);
else
active_remotely = lv_is_active_but_not_locally(lv);
} else
active_remotely = 0;