1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/libdm
Peter Rajnoha 2f7f6932dc report: selection: fix selection criteria to not match reserved values when using >, <, >=, <
Some values are reserved for special purpose like 'undefined', 'unmanaged' etc.
When using >, <, >= and < comparison operators where the range is considered,
do not include reserved values as proper values in this range which
would otherwise result in not so obvious criteria match (as the reserved value is
actually transparent for the user). It's incorrect.

Example scenario:
$ vgs -o vg_name,vg_mda_copies vg1 vg2
  VG   #VMdaCps
  vg1          1
  vg2  unmanaged

The "unmanaged" is actually mapped onto reserved value
18446744073709551615 (2^64 - 1) internally.

Such reseved value is already caught on selection criteria input
properly:

$ vgs -o name,vg_mda_copies vg1 vg2 -S 'vg_mda_copies=18446744073709551615'
  Numeric value 18446744073709551615 found in selection is reserved.

However, we still need to fix situaton where the reserved value may be
included in resulting range:

Before this patch:
$ vgs -o vg_name,vg_mda_copies vg1 vg2 -S 'vg_mda_copies >= 1'
  VG   #VMdaCps
  vg1          1
  vg2  unmanaged

With this patch applied:
$ vgs -o vg_name,vg_mda_copies vg1 vg2 -S 'vg_mda_copies >= 1'
  VG   #VMdaCps
  vg1         1

From the examples above, we can see that without this patch applied,
the vg_mda_copies >= 1 also matched the reserved value 18446744073709551615
(which is represented by the "unamanged" string on report). When
applying the operators, such values must be skipped! They're meant to
be matched only against their string representation only, e.g.:

$ vgs -o name,vg_mda_copies vg1 vg2 -S 'vg_mda_copies=unmanaged'
  VG   #VMdaCps
  vg2  unmanaged

...or any synonyms:

$ vgs -o name,vg_mda_copies vg1 vg2 -S 'vg_mda_copies=undefined'
  VG   #VMdaCps
  vg2  unmanaged
2014-10-27 11:25:08 +01:00
..
datastruct Use void pointer instead of char for binary key 2011-03-10 12:48:40 +00:00
ioctl libdm: finish the comment 2014-09-12 15:35:57 +02:00
misc libdm: Add DM_DEFERRED_REMOVE to dm-ioctl.h. 2014-08-15 13:45:55 +01:00
mm debug: avoid warning when compiled with valgrind 2014-03-27 13:13:08 +01:00
regex cleanup: add braces for if() 2014-07-02 10:45:43 +02:00
.exported_symbols dmsetup: Support remove --deferred. 2014-08-16 00:34:48 +01:00
libdevmapper.h libdm: add DM_LIST_HEAD_INIT macro 2014-10-24 16:39:31 +02:00
libdevmapper.pc.in Switch to use Requires.private for devmapper.pc and lvm2app.pc 2010-05-11 08:54:11 +00:00
libdm-common.c libdm: revert incorrect path length size for sscanf 2014-08-29 13:10:18 +02:00
libdm-common.h libdm: introduce and use DEV_UUID macro 2012-10-10 17:16:15 +02:00
libdm-config.c cleanup: include stdarg.h where needed. 2014-04-18 16:38:50 +02:00
libdm-deptree.c libdm: add check transaction_id after message 2014-08-26 14:12:20 +02:00
libdm-file.c Drop unreachable code 2012-02-08 12:59:45 +00:00
libdm-report.c report: selection: fix selection criteria to not match reserved values when using >, <, >=, < 2014-10-27 11:25:08 +01:00
libdm-string.c cleanup: libdm simplier error comparation 2014-07-02 10:45:42 +02:00
Makefile.in libdm: Add missing UDEV_CFLAGS. 2014-04-01 15:26:26 +02:00