1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

report: fix regression while selecting string fields using synonyms

$ lvs -o name,cache_policy vg/lvol0
  LV    Cache Policy
  lvol0

Before this patch:
$ lvs -o name,cache_policy -S 'cache_policy=undefined' vg/lvol0
  (no match)

With this patch applied:
$ lvs -o name,cache_policy -S 'cache_policy=undefined' vg/lvol0
  LV    Cache Policy
  lvol0
This commit is contained in:
Peter Rajnoha 2015-07-02 11:31:54 +02:00
parent 7f63fff9c4
commit 454782f1a3
2 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.124 -
=================================
Fix regression in select to match string fields if using synonyms (2.02.123).
Fix regression when printing more lv names via display_lvname (2.02.122).
Add missing error logging to unlock_vg and sync_local_dev_names callers.

View File

@ -1505,9 +1505,9 @@ static int _cmp_field_string(struct dm_report *rh __attribute__((unused)),
switch (fs->flags & FLD_CMP_MASK) {
case FLD_CMP_EQUAL:
return _check_value_is_strictly_reserved(rh, field_num, DM_REPORT_FIELD_TYPE_STRING, val, fs) ? 0 : !strcmp(val, sel);
return !strcmp(val, sel);
case FLD_CMP_NOT|FLD_CMP_EQUAL:
return _check_value_is_strictly_reserved(rh, field_num, DM_REPORT_FIELD_TYPE_STRING, val, fs) ? 0 : strcmp(val, sel);
return strcmp(val, sel);
default:
log_error(INTERNAL_ERROR "_cmp_field_string: unsupported string "
"comparison type for selection field %s", field_id);