Skip to content

Commit

Permalink
RGW - Fix inverted return check
Browse files Browse the repository at this point in the history
get_obj_head_ioctx() returns the standard int but the call was casting
it to a bool, inverting it's meaning.  Fix it to act correctly.

Fixes: https://tracker.ceph.com/issues/54452
Signed-off-by: Daniel Gryniewicz <dang@redhat.com>
  • Loading branch information
dang committed Mar 4, 2022
1 parent f735432 commit 988c09d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/rgw/rgw_rados.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9210,15 +9210,14 @@ int RGWRados::check_disk_state(const DoutPrefixProvider *dpp,
list_state.meta.content_type = content_type;

librados::IoCtx head_obj_ctx; // initialize to data pool so we can get pool id
const bool head_pool_found =
get_obj_head_ioctx(dpp, bucket_info, obj, &head_obj_ctx);
if (head_pool_found) {
list_state.ver.pool = head_obj_ctx.get_id();
list_state.ver.epoch = astate->epoch;
} else {
int ret = get_obj_head_ioctx(dpp, bucket_info, obj, &head_obj_ctx);
if (ret < 0) {
ldpp_dout(dpp, 0) << __PRETTY_FUNCTION__ <<
" WARNING: unable to find head object data pool for \"" <<
obj << "\", not updating version pool/epoch" << dendl;
} else {
list_state.ver.pool = head_obj_ctx.get_id();
list_state.ver.epoch = astate->epoch;
}

if (astate->obj_tag.length() > 0) {
Expand Down

0 comments on commit 988c09d

Please sign in to comment.