1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 11:55:55 +03:00
lvm2/lib
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
..
activate coverity: fix error paths 2016-04-22 01:12:34 +02:00
cache coverity: ignore some dm_strncpy results 2016-04-22 14:15:36 +02:00
cache_segtype activate: Use macros for target and module names. 2016-03-22 17:46:15 +00:00
commands lvmetad: warn about making changes while not using lvmetad 2016-04-21 10:28:01 -05:00
config lvmetad: preemptively check and rescan in commands 2016-04-13 14:05:42 -05:00
datastruct doc: change fsf address 2016-01-21 12:11:37 +01:00
device coverity: use wider type for whole expression 2016-04-22 01:12:34 +02:00
display display: Avoid internal snapshot LV names in msgs. 2016-04-21 00:30:17 +01:00
error activate: Use macros for target and module names. 2016-03-22 17:46:15 +00:00
filters dev-cache: also index VGIDs and LVIDs if using persistent .cache file 2016-03-30 11:00:01 +02:00
format1 redefine pvcreate structs 2016-02-25 09:14:10 -06:00
format_pool redefine pvcreate structs 2016-02-25 09:14:10 -06:00
format_text debug: move misplaced log_debug 2016-04-21 00:34:01 +02: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 cleanup: simplify code 2016-04-22 00:22:02 +02:00
log dbus: add notification from commands 2016-03-07 10:06:09 -06:00
lvmpolld doc: change fsf address 2016-01-21 12:11:37 +01:00
metadata metadata: log warning instead of error if device not found while checking used and assumed devs 2016-04-25 11:27:28 +02:00
mirror activate: Use macros for target and module names. 2016-03-22 17:46:15 +00:00
misc debug: unify some tracing messages 2016-04-12 13:06:16 +02:00
mm doc: change fsf address 2016-01-21 12:11:37 +01:00
notify coverity: drop unused header file 2016-04-22 01:12:34 +02:00
properties doc: change fsf address 2016-01-21 12:11:37 +01:00
raid activate: Use macros for target and module names. 2016-03-22 17:46:15 +00:00
replicator doc: change fsf address 2016-01-21 12:11:37 +01:00
report coverity: is_used_pv needs valid pv pointer 2016-04-22 14:15:36 +02:00
snapshot activate: Use macros for target and module names. 2016-03-22 17:46:15 +00:00
striped activate: Use macros for target and module names. 2016-03-22 17:46:15 +00:00
thin Revert "thin: display highest mapped sector" 2016-04-01 20:09:38 +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 activate: Use macros for target and module names. 2016-03-22 17:46:15 +00:00
Makefile.in dbus: add notification from commands 2016-03-07 10:06:09 -06:00