[linux-lvm] [PATCH] lvs: add -o lv_usable

Zdenek Kabelac zdenek.kabelac at gmail.com
Mon Sep 7 14:32:47 UTC 2020


Dne 05. 09. 20 v 11:08 heming.zhao at suse.com napsal(a):
> 
> 
> On 9/5/20 5:06 PM, Zhao Heming wrote:
>> report LV is usable for upper layer.
>>
>> Signed-off-by: Zhao Heming <heming.zhao at suse.com>
>> ---
>>    lib/activate/activate.h          |   2 +
>>    lib/activate/dev_manager.c       |  67 ++++++++++++++++
>>    lib/metadata/metadata-exported.h |   1 +
>>    lib/metadata/metadata.c          | 130 +++++++++++++++++++++++++++++++
>>    lib/report/columns.h             |   1 +
>>    lib/report/properties.c          |   2 +
>>    lib/report/report.c              |  13 ++++
>>    lib/report/values.h              |   1 +
>>    8 files changed, 217 insertions(+)
>>
> 
> my test result:
> 
> ## linear
> 

Hi

We will need to take closer look  - the patchset itself is not going in right 
direction - since all the info about missing or present devices is already
available within lvm engine and we want to minimize 'repeated' query
(ideally all the information should be checked only once - otherwise
the decision state-machine is producing random-end result garbage - which
is the very hard to trace and debug.

So all the code which is doing runtime query again can't be accepted.

Next main rule is - we cache status values whenever possible - so there
should be at most  1 'status' per device per LV - but since lvm2 already
knows from scanning point and from metadata parsing which device is missing
the logic of evaluation of LV's usability needs to be based on these values.

But I think we also need some per-segment methods evaluating usability.

Regards

Zdenek




More information about the linux-lvm mailing list