1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib
Peter Rajnoha d97f1c89de metadata: _vg_read: check if PV_EXT_USED flag is set correctly for orphan PVs and do a repair if needed
If we know that the PV is orphan, meaning there's at least one MDA on
that PV which does not reference any VG and at the same time there's
PV_EXT_USED flag set, we're certainly in an inconsistent state and we
need to fix this.

For example, such situation can happen during vgremove/vgreduce if we
removed/reduced the VG, but we haven't written PV headers yet because
vgremove stopped abruptly for whatever reason just before writing new
PV headers with updated state, including PV extension flags (and so the
PV_EXT_USED flag).

However, in case the PV has no MDAs at all, we can't double-check
whether the PV_EXT_USED is correct or not - if that PV is marked
as used, it's either:
  - really used (but other disks with MDAs are missing)
  - or the error state as described above is hit

User needs to overwrite the PV header directly if it's really clear
the PV having no MDAs does not belong to any VG and at the same time
it's still marked as being in use (pvcreate -ff <dev_name> will fix this).

For example - /dev/sda here has 1 MDA, orphan and is incorrectly marked
with PV_EXT_USED flag:

$ pvs --binary -o+pv_in_use
  WARNING: Found inconsistent standalone Physical Volumes.
  WARNING: Repairing flag incorrectly marking Physical Volume /dev/sda as used.
  PV         VG     Fmt  Attr PSize   PFree   InUse
  /dev/sda          lvm2 ---  128.00m 128.00m     0
2016-02-15 12:44:46 +01:00
..
activate debug: cut_and_paste type in message 2016-02-11 18:38:40 +01:00
cache lvmcache/lvmetad: cache PV extension version 2016-02-15 12:44:46 +01:00
cache_segtype doc: change fsf address 2016-01-21 12:11:37 +01:00
commands config: fix verbose type to int 2016-02-11 18:30:39 +01:00
config config: fix verbose type to int 2016-02-11 18:30:39 +01:00
datastruct doc: change fsf address 2016-01-21 12:11:37 +01:00
device filters: partitioned: fix partition table filter with external_device_info_source="udev" and blkid<2.20 2016-02-02 13:28:11 +01:00
display doc: change fsf address 2016-01-21 12:11:37 +01:00
error doc: change fsf address 2016-01-21 12:11:37 +01:00
filters filter: do not check for suspended devs in filter-usable in lvmetad mode 2016-02-03 14:57:36 +01:00
format1 lvmcache/lvmetad: cache PV extension version 2016-02-15 12:44:46 +01:00
format_pool lvmcache/lvmetad: cache PV extension version 2016-02-15 12:44:46 +01:00
format_text pv: format-text: store PV_EXT_USED flag if PV is used and unset it otherwise 2016-02-15 12:44:46 +01:00
freeseg doc: change fsf address 2016-01-21 12:11:37 +01:00
label doc: change fsf address 2016-01-21 12:11:37 +01:00
locking lvmlockd: remove noisy log_debug 2016-01-21 14:37:15 -06:00
log doc: change fsf address 2016-01-21 12:11:37 +01:00
lvmpolld doc: change fsf address 2016-01-21 12:11:37 +01:00
metadata metadata: _vg_read: check if PV_EXT_USED flag is set correctly for orphan PVs and do a repair if needed 2016-02-15 12:44:46 +01:00
mirror doc: change fsf address 2016-01-21 12:11:37 +01:00
misc doc: change fsf address 2016-01-21 12:11:37 +01:00
mm doc: change fsf address 2016-01-21 12:11:37 +01:00
properties doc: change fsf address 2016-01-21 12:11:37 +01:00
raid doc: change fsf address 2016-01-21 12:11:37 +01:00
replicator doc: change fsf address 2016-01-21 12:11:37 +01:00
report report: add pv_in_use field to display whether PV is in use or not 2016-02-15 12:44:46 +01:00
snapshot doc: change fsf address 2016-01-21 12:11:37 +01:00
striped doc: change fsf address 2016-01-21 12:11:37 +01:00
thin thin: fix low_water_mark threshold calc 2016-02-11 18:30:24 +01:00
unknown doc: change fsf address 2016-01-21 12:11:37 +01:00
uuid doc: change fsf address 2016-01-21 12:11:37 +01:00
zero doc: change fsf address 2016-01-21 12:11:37 +01:00
Makefile.in doc: change fsf address 2016-01-21 12:11:37 +01:00