]> sourceware.org Git - lvm2.git/commitdiff
libdm: reapply "fix condition" 1285949545
authorZdenek Kabelac <zkabelac@redhat.com>
Fri, 10 May 2024 11:53:11 +0000 (13:53 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Fri, 10 May 2024 12:24:17 +0000 (14:24 +0200)
This reverts commit d16a8f80e9dd21d97b10056858a21b7e8fbd8c94.
So the correction was OK, however we missed to fix also
cut&paste bug here - as the second check should be
actually checking  field->type.

device_mapper/libdm-report.c
libdm/libdm-report.c

index 86c95e109c0eb4c9b51c57d3cd6e88925af536c7..0506ba47ffbf0016f3d45c0940f1351fa2b2c252 100644 (file)
@@ -2589,7 +2589,8 @@ static int _check_reserved_values_supported(const struct dm_report_field_type fi
                if (iter->type & DM_REPORT_FIELD_TYPE_MASK) {
                        if (!(iter->type & supported_reserved_types) ||
                            ((iter->type & DM_REPORT_FIELD_RESERVED_VALUE_RANGE) &&
-                            !(iter->type & supported_reserved_types_with_range))) {
+                            !(iter->type & (supported_reserved_types_with_range &
+                                            ~DM_REPORT_FIELD_RESERVED_VALUE_RANGE)))) {
                                log_error(INTERNAL_ERROR "_check_reserved_values_supported: "
                                          "global reserved value for type 0x%x not supported",
                                           iter->type);
@@ -2599,8 +2600,9 @@ static int _check_reserved_values_supported(const struct dm_report_field_type fi
                        field_res = (const struct dm_report_field_reserved_value *) iter->value;
                        field = &fields[field_res->field_num];
                        if (!(field->flags & supported_reserved_types) ||
-                           ((iter->type & DM_REPORT_FIELD_RESERVED_VALUE_RANGE) &&
-                            !(iter->type & supported_reserved_types_with_range))) {
+                           ((field->type & DM_REPORT_FIELD_RESERVED_VALUE_RANGE) &&
+                            !(field->type & (supported_reserved_types_with_range &
+                                            ~DM_REPORT_FIELD_RESERVED_VALUE_RANGE)))) {
                                log_error(INTERNAL_ERROR "_check_reserved_values_supported: "
                                          "field-specific reserved value of type 0x%x for "
                                          "field %s not supported",
index d6a01060f73239b345a815017d13e15609a07662..78d08b2344fbb5eadaaf408671504cb7c4eaf3e9 100644 (file)
@@ -2587,7 +2587,8 @@ static int _check_reserved_values_supported(const struct dm_report_field_type fi
                if (iter->type & DM_REPORT_FIELD_TYPE_MASK) {
                        if (!(iter->type & supported_reserved_types) ||
                            ((iter->type & DM_REPORT_FIELD_RESERVED_VALUE_RANGE) &&
-                            !(iter->type & supported_reserved_types_with_range))) {
+                            !(iter->type & (supported_reserved_types_with_range &
+                                            ~DM_REPORT_FIELD_RESERVED_VALUE_RANGE)))) {
                                log_error(INTERNAL_ERROR "_check_reserved_values_supported: "
                                          "global reserved value for type 0x%x not supported",
                                           iter->type);
@@ -2597,8 +2598,9 @@ static int _check_reserved_values_supported(const struct dm_report_field_type fi
                        field_res = (const struct dm_report_field_reserved_value *) iter->value;
                        field = &fields[field_res->field_num];
                        if (!(field->flags & supported_reserved_types) ||
-                           ((iter->type & DM_REPORT_FIELD_RESERVED_VALUE_RANGE) &&
-                            !(iter->type & supported_reserved_types_with_range))) {
+                           ((field->type & DM_REPORT_FIELD_RESERVED_VALUE_RANGE) &&
+                            !(field->type & (supported_reserved_types_with_range &
+                                            ~DM_REPORT_FIELD_RESERVED_VALUE_RANGE)))) {
                                log_error(INTERNAL_ERROR "_check_reserved_values_supported: "
                                          "field-specific reserved value of type 0x%x for "
                                          "field %s not supported",
This page took 0.04682 seconds and 5 git commands to generate.