Project

General

Profile

Actions

Bug #51934

closed

rgw-multisite: metadata conflict not computed correctly

Added by J. Eric Ivancich over 2 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Normal
Target version:
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

The code below causes a compiler warning about a potentially uninitialized variable `_mode`. Looking at it, the problem may be deeper. The "++i" conditional looks like it will never be executed.

  int i = 0;
  for (auto& iter : iters) {
    auto& rule_params = iter->second->params;
    if (++i == 0) {
      _acl_translation = rule_params.dest.acl_translation;
      _storage_class = rule_params.dest.storage_class;
      _mode = rule_params.mode;
      continue;
    }

    conflict = !(_acl_translation == rule_params.dest.acl_translation &&
                 _storage_class == rule_params.dest.storage_class &&
                 _mode == rule_params.mode);
    if (conflict) {
      *need_more_info = true;
      return false;
    }
  }
Actions #1

Updated by J. Eric Ivancich over 2 years ago

  • Target version set to v17.0.0
  • Backport set to need to check
Actions #2

Updated by J. Eric Ivancich over 2 years ago

  • Subject changed from rgw-multisite: unexecutable code, uninitialized variables to rgw-multisite: metadata conflict not computed correctly
Actions #3

Updated by J. Eric Ivancich over 2 years ago

  • Pull request ID set to 42532
Actions #4

Updated by Casey Bodley over 2 years ago

  • Status changed from New to Fix Under Review
Actions #5

Updated by J. Eric Ivancich over 2 years ago

  • Status changed from Fix Under Review to Resolved
  • Backport deleted (need to check)
Actions

Also available in: Atom PDF