Merge pull request #69821 from sunyuechi/wip-rgw-inverted-checks

rgw: fix three inverted condition checks

Reviewed-by: Daniel Gryniewicz <dang1@ibm.com>
This commit is contained in:
Kefu Chai 2026-07-27 20:27:46 +08:00 committed by GitHub
commit 8131835af8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -4713,7 +4713,7 @@ int POSIXAtomicWriter::complete(size_t accounted_size, const std::string& etag,
if (if_nomatch) {
if (strcmp(if_nomatch, "*") == 0) {
// test the object is not existing
if (!exists) {
if (exists) {
return -ERR_PRECONDITION_FAILED;
}
} else {

View File

@ -8282,7 +8282,7 @@ void RGWDeleteMultiObj::execute(optional_yield y)
bool has_versioned = false;
for (auto object : multi_delete->objects) {
const string& instance = object.get_version_id();
if (instance.empty()) {
if (!instance.empty()) {
has_versioned = true;
break;
}

View File

@ -279,7 +279,7 @@ int AssumeRoleRequest::validate_input(const DoutPrefixProvider *dpp) const
return -EINVAL;
}
}
if (! tokenCode.empty() && tokenCode.size() == TOKEN_CODE_SIZE) {
if (! tokenCode.empty() && tokenCode.size() != TOKEN_CODE_SIZE) {
ldpp_dout(dpp, 0) << "Either token code is empty or token code size is invalid: " << tokenCode.size() << dendl;
return -EINVAL;
}