Skip to contentSkip to conversation

Filtering out LVs?

DISCUSSION Jun'ichi Nomura 2 participants 2 messages Mar 29, 2011 – Mar 31, 2011

lore
Share & tools
lore
#0 lore raw

Hi,

LVM2 commands scan /dev for metadata read-in and validation. By default, it includes DM devices.

On the other hand, LV deactivation checks its open count and fails if it's open.

So there is a race that one of multiple vgchange instances prevents other; "vgchange -an vg0" might fail to deactivate the VG if "vgchange -an vg1" opens vg0/lv0 at the very time for scanning.

E.g. try this:
From one console,

     # while true; do vgscan; done
   and from other console,
     # while true; do vgchange -ay $VG; vgchange -an $VG || break; done

While device filter can be configured to avoid LV devices, and also someone may want to use LV as PV,
it seems inconvenient default behavior.

Does it make sense to add a filter to avoid LVs? (It has to cope with multiple udev-oriented aliases...)

Signature · 1 line
Jun'ichi Nomura, NEC Corporation
#1 lore raw
Quoted 3 lines · Jun'ichi Nomura

So there is a race that one of multiple vgchange instances prevents other; "vgchange -an vg0" might fail to deactivate the VG if "vgchange -an vg1" opens vg0/lv0 at the very time for scanning.

I'm inclined not to do anything about this at the moment, but to wait until udev+new cache work is complete then revisit it if the problem hasn't gone away.

Alasdair