]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
RGW - Fix inverted return check 45315/head
authorDaniel Gryniewicz <dang@redhat.com>
Wed, 2 Mar 2022 15:54:29 +0000 (10:54 -0500)
committerDaniel Gryniewicz <dang@redhat.com>
Tue, 8 Mar 2022 19:05:51 +0000 (14:05 -0500)
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>
(cherry picked from commit 988c09d5ad7d32238dbf59792ea336a6d933cef8)

src/rgw/rgw_rados.cc

index 5fb9e9f3c48b55cae7aca35918aa15f646c953b7..2e418c205c4ce3a119844dfe830330d29802d198 100644 (file)
@@ -9203,15 +9203,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) {