]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: move check condition into maybe_handle_manifest_detail()
authormyoungwon oh <ohmyoungwon@gmail.com>
Wed, 3 Mar 2021 14:02:49 +0000 (23:02 +0900)
committermyoungwon oh <ohmyoungwon@gmail.com>
Mon, 29 Mar 2021 08:22:11 +0000 (17:22 +0900)
Signed-off-by: Myoungwon Oh <myoungwon.oh@samsung.com>
src/osd/PrimaryLogPG.cc

index 949461de6874b2ab6aa31e0f7efb98694c27203a..0d3dc38416664a25f55fc4d7f8527be0d03fef53 100644 (file)
@@ -2328,7 +2328,7 @@ void PrimaryLogPG::do_op(OpRequestRef& op)
       return;
   }
 
-  if (obc.get() && obc->obs.exists && obc->obs.oi.has_manifest()) {
+  if (obc.get() && obc->obs.exists) {
     if (recover_adjacent_clones(obc, op)) {
       return;
     }
@@ -2469,6 +2469,11 @@ PrimaryLogPG::cache_result_t PrimaryLogPG::maybe_handle_manifest_detail(
   ObjectContextRef obc)
 {
   ceph_assert(obc);
+  if (!obc->obs.oi.has_manifest()) {
+    dout(20) << __func__ << ": " << obc->obs.oi.soid 
+            << " is not manifest object " << dendl;
+    return cache_result_t::NOOP;
+  }
   if (op->get_req<MOSDOp>()->get_flags() & CEPH_OSD_FLAG_IGNORE_REDIRECT) {
     dout(20) << __func__ << ": ignoring redirect due to flag" << dendl;
     return cache_result_t::NOOP;
@@ -8213,16 +8218,11 @@ int PrimaryLogPG::_rollback_to(OpContext *ctx, ceph_osd_op& op)
     ObjectContextRef promote_obc;
     cache_result_t tier_mode_result;
     if (obs.exists && obs.oi.has_manifest()) {
-      if (!rollback_to->obs.oi.has_manifest()) {
-       // rollback_to is not manifest object
-       tier_mode_result = cache_result_t::NOOP;
-      } else {
-       tier_mode_result =
-         maybe_handle_manifest_detail(
-           ctx->op,
-           true,
-           rollback_to);
-      }
+      tier_mode_result =
+       maybe_handle_manifest_detail(
+         ctx->op,
+         true,
+         rollback_to);
     } else {
       tier_mode_result =
        maybe_handle_cache_detail(