]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: return an error earlier in start_flush() if non-blocking is enabled
authormyoungwon oh <ohmyoungwon@gmail.com>
Sat, 31 Oct 2020 08:19:43 +0000 (17:19 +0900)
committermyoungwon oh <ohmyoungwon@gmail.com>
Sat, 31 Oct 2020 08:19:43 +0000 (17:19 +0900)
Signed-off-by: Myoungwon Oh <myoungwon.oh@samsumg.com>
src/osd/PrimaryLogPG.cc

index 27f71605ca24cb0e5ce6801667b04168723f2db1..3d969585f65d261dcbbbdbc92d23df890e611612 100644 (file)
@@ -10012,9 +10012,7 @@ int PrimaryLogPG::start_dedup(OpRequestRef op, ObjectContextRef obc)
   const object_info_t& oi = obc->obs.oi;
   const hobject_t& soid = oi.soid;
 
-  if (!obc->is_blocked()) {
-    return -EINVAL;
-  }
+  ceph_assert(obc->is_blocked());
 
   /*
    * The operations to make dedup chunks are tracked by a ManifestOp.
@@ -10184,6 +10182,7 @@ void PrimaryLogPG::finish_set_dedup(hobject_t oid, int r, ceph_tid_t tid, uint64
       osd->reply_op_error(mop->op, -EINVAL);
     return;
   }
+  ceph_assert(obc->is_blocked());
   obc->stop_block();
   kick_object_context_blocked(obc);
   if (r < 0) {
@@ -10264,6 +10263,13 @@ int PrimaryLogPG::start_flush(
     snapset = obc->ssc->snapset;
   }
 
+  if (obc->obs.oi.has_manifest() && obc->obs.oi.manifest.is_chunked()) {
+    // current dedup tier only supports blocking operation
+    if (!blocking) {
+      return -EOPNOTSUPP;
+    }
+  }
+
   // verify there are no (older) check for dirty clones
   {
     dout(20) << " snapset " << snapset << dendl;