]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: do not reply EAGAIN if get_lock_type() is false
authormyoungwon oh <ohmyoungwon@gmail.com>
Wed, 2 Dec 2020 02:51:10 +0000 (11:51 +0900)
committermyoungwon oh <ohmyoungwon@gmail.com>
Wed, 2 Dec 2020 03:06:22 +0000 (12:06 +0900)
This will be retried later

Signed-off-by: Myoungwon Oh <myoungwon.oh@samsumg.com>
src/osd/PrimaryLogPG.cc
src/osd/PrimaryLogPG.h

index 0831fa8fb05795a56cd3b24627855d7c36635a46..68df64cf5f93a3f94c763804a374c1013bd0f472 100644 (file)
@@ -10179,14 +10179,14 @@ hobject_t PrimaryLogPG::get_fpoid_from_chunk(const hobject_t soid, bufferlist& c
   return target;
 }
 
-void PrimaryLogPG::finish_set_dedup(hobject_t oid, int r, ceph_tid_t tid, uint64_t offset)
+int PrimaryLogPG::finish_set_dedup(hobject_t oid, int r, ceph_tid_t tid, uint64_t offset)
 {
   dout(10) << __func__ << " " << oid << " tid " << tid
           << " " << cpp_strerror(r) << dendl;
   map<hobject_t,ManifestOpRef>::iterator p = manifest_ops.find(oid);
   if (p == manifest_ops.end()) {
     dout(10) << __func__ << " no manifest_op found" << dendl;
-    return;
+    return -EINVAL;
   }
   ManifestOpRef mop = p->second;
   mop->results[offset] = r;
@@ -10196,13 +10196,13 @@ void PrimaryLogPG::finish_set_dedup(hobject_t oid, int r, ceph_tid_t tid, uint64
   }
   if (mop->num_chunks != mop->results.size()) {
     // there are on-going works
-    return;
+    return -EINPROGRESS;
   }
   ObjectContextRef obc = get_object_context(oid, false);
   if (!obc) {
     if (mop->op)
       osd->reply_op_error(mop->op, -EINVAL);
-    return;
+    return -EINVAL;
   }
   ceph_assert(obc->is_blocked());
   obc->stop_block();
@@ -10212,7 +10212,7 @@ void PrimaryLogPG::finish_set_dedup(hobject_t oid, int r, ceph_tid_t tid, uint64
     ceph_assert(mop->num_chunks == mop->results.size());
     manifest_ops.erase(oid);
     osd->reply_op_error(mop->op, mop->results[0]);
-    return;
+    return -EIO;
   }
 
   if (mop->chunks.size()) {
@@ -10227,8 +10227,7 @@ void PrimaryLogPG::finish_set_dedup(hobject_t oid, int r, ceph_tid_t tid, uint64
     } else if (mop->op) {
       dout(10) << __func__ << " waiting on write lock " << mop->op << dendl;
       close_op_ctx(ctx.release());
-      osd->reply_op_error(mop->op, -EAGAIN);
-      return;    
+      return -EAGAIN;    
     }
 
     ctx->at_version = get_next_version();
@@ -10282,6 +10281,7 @@ void PrimaryLogPG::finish_set_dedup(hobject_t oid, int r, ceph_tid_t tid, uint64
     osd->reply_op_error(mop->op, r);
 
   manifest_ops.erase(oid);
+  return 0;
 }
 
 int PrimaryLogPG::start_flush(
index 8ce17ba437e841babe8bd3ae04388364d573b4c7..bc682332dba058a1f72932f720851194c81e21a6 100644 (file)
@@ -1516,7 +1516,7 @@ protected:
             std::map<uint64_t, bufferlist>& chunks);
   int start_dedup(OpRequestRef op, ObjectContextRef obc);
   hobject_t get_fpoid_from_chunk(const hobject_t soid, bufferlist& chunk);
-  void finish_set_dedup(hobject_t oid, int r, ceph_tid_t tid, uint64_t offset);
+  int finish_set_dedup(hobject_t oid, int r, ceph_tid_t tid, uint64_t offset);
 
   friend struct C_ProxyChunkRead;
   friend class PromoteManifestCallback;