]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
objecter: don't serialize responses if there's no object name
authorYehuda Sadeh <yehuda@inktank.com>
Wed, 28 May 2014 19:12:31 +0000 (12:12 -0700)
committerJohn Spray <john.spray@redhat.com>
Mon, 25 Aug 2014 00:34:00 +0000 (01:34 +0100)
This implicitly fixes an issue with the list_objects() being reentrant,
and triggers a lock dependency issue. The better solution would be to
have the callback context specify whether it's reentrant or not, but
will require a much bigger change.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/osdc/Objecter.cc

index ed364e43e87a4dd9b557991cc8d668fd5566dcdd..ff151b05e65ff51e63d03e7490544994c3b77e4c 100644 (file)
@@ -2361,7 +2361,7 @@ void Objecter::handle_osd_op_reply(MOSDOpReply *m)
   }
 
   /* get it before we call _finish_op() */
-  Mutex *completion_lock = s->get_lock(op->target.base_oid);
+  Mutex *completion_lock = (op->target.base_oid.name.size() ? s->get_lock(op->target.base_oid) : NULL);
 
   // done with this tid?
   if (!op->onack && !op->oncommit) {
@@ -2372,8 +2372,9 @@ void Objecter::handle_osd_op_reply(MOSDOpReply *m)
   ldout(cct, 5) << num_unacked.read() << " unacked, " << num_uncommitted.read() << " uncommitted" << dendl;
 
   // serialize completions
-
-  completion_lock->Lock();
+  if (completion_lock) {
+    completion_lock->Lock();
+  }
   s->lock.unlock();
 
   // do callbacks
@@ -2383,7 +2384,9 @@ void Objecter::handle_osd_op_reply(MOSDOpReply *m)
   if (oncommit) {
     oncommit->complete(rc);
   }
-  completion_lock->Unlock();
+  if (completion_lock) {
+    completion_lock->Unlock();
+  }
 
   m->put();
   s->put();