1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 11:55:55 +03:00
lvm2/lib/metadata
Peter Rajnoha 9d976c0002 metadata: log warning instead of error if device not found while checking used and assumed devs
When checking assumed PVs against real devices used for LVs and if
there's no device assigned for an assumed PV (e.g. due to filters),
do log_warn instead of log_error and continue checking LV segments
and associated assumed PVs further, just like we do log_warn elsewhere
in this situation.

This way user will see the warning for each LV which couldn't be
checked completely against real PVs used. Before, we logged only
the very first occurence of missing device for an LV in a VG and we
returned from the function doing this check for all the LVs in VG
immediately which may be a bit misleading because it didn't tell
user about all the other LVs and whether they could be checked
or not.

For example, we have this setup:

[0] fedora/~ # pvs
  PV         VG     Fmt  Attr PSize   PFree
  /dev/sda          lvm2 ---  128.00m 128.00m
  /dev/vda2  fedora lvm2 a--   19.49g      0

[0] fedora/~ # lvs -o+devices
  LV   VG     Attr       LSize   Devices
  root fedora -wi-ao----  19.00g /dev/vda2(0)
  swap fedora -wi-ao---- 500.00m /dev/vda2(4864)

Before this patch (only the very first LV in a VG is logged to have a
problem while checking used and assumed devices):

[0] fedora/~ # pvs --config 'devices/filter=["a|/dev/sda|", "r|.*|"]'
  WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter.
  WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter.
  Couldn't find device for segment belonging to fedora/root while checking used and assumed devices.
  PV         VG     Fmt  Attr PSize   PFree
  /dev/sda          lvm2 ---  128.00m 128.00m
  [unknown]  fedora lvm2 a-m   19.49g      0

With this patch applied (all LVs where we hit problem while checking
used and assumed devices are logged and it's warning, not error):

[0] fedora/~ # pvs --config 'devices/filter=["a|/dev/sda|", "r|.*|"]'
  WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter.
  WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter.
  WARNING: Couldn't find device for segment belonging to fedora/root while checking used and assumed devices.
  WARNING: Couldn't find device for segment belonging to fedora/swap while checking used and assumed devices.
  PV         VG     Fmt  Attr PSize   PFree
  /dev/sda          lvm2 ---  128.00m 128.00m
  [unknown]  fedora lvm2 a-m   19.49g      0
2016-04-25 11:27:28 +02:00
..
cache_manip.c cache: fix previous change and correct () 2016-04-22 12:52:53 +02:00
lv_alloc.h doc: change fsf address 2016-01-21 12:11:37 +01:00
lv_manip.c activate: Hide errors when snapshot merge delayed. 2016-04-21 22:14:10 +01:00
lv.c cache: check for cache fail during flush 2016-03-10 18:38:53 +01:00
lv.h coverity: avoid using signed types for single bits 2016-04-22 01:12:34 +02:00
merge.c metadata: also validate historical LVs in VG in vg_validate and check_lv_segments 2016-03-03 13:50:59 +01:00
metadata-exported.h display: Avoid internal snapshot LV names in msgs. 2016-04-21 00:30:17 +01:00
metadata.c metadata: log warning instead of error if device not found while checking used and assumed devs 2016-04-25 11:27:28 +02:00
metadata.h metadata: add support for interconnection of thin pool LV segment with indirect origin 2016-03-03 13:46:40 +01:00
mirror.c metadata: also look at historical LVs when checking LV name availability 2016-03-03 13:50:59 +01:00
pool_manip.c metadata: also look at historical LVs when checking LV name availability 2016-03-03 13:50:59 +01:00
pv_alloc.h doc: change fsf address 2016-01-21 12:11:37 +01:00
pv_manip.c cleanup: indent 2016-02-25 23:30:25 +01:00
pv_map.c doc: change fsf address 2016-01-21 12:11:37 +01:00
pv_map.h doc: change fsf address 2016-01-21 12:11:37 +01:00
pv.c report: Shift (u)sed pv_attr under (a)llocatable. 2016-02-26 15:46:37 +00:00
pv.h pv: add is_used_pv fn 2016-02-15 12:44:46 +01:00
raid_manip.c raid_manip: allow for raid leg to be replaced when not both data and metadata image are on pvs 2016-03-07 15:25:30 +01:00
replicator_manip.c doc: change fsf address 2016-01-21 12:11:37 +01:00
segtype.c doc: change fsf address 2016-01-21 12:11:37 +01:00
segtype.h doc: change fsf address 2016-01-21 12:11:37 +01:00
snapshot_manip.c display: Avoid internal snapshot LV names in msgs. 2016-04-21 00:30:17 +01:00
thin_manip.c gcc: cleanup some sign warnings 2016-02-23 12:25:25 +01:00
vg.c metadata: add historical_glv_remove 2016-03-03 13:50:57 +01:00
vg.h metadata: add historical_glv_remove 2016-03-03 13:50:57 +01:00