]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
MDCache: handle internal ops in respond_to_request()
authorGreg Farnum <greg@inktank.com>
Fri, 29 Aug 2014 06:25:42 +0000 (23:25 -0700)
committerGreg Farnum <gfarnum@redhat.com>
Fri, 7 Nov 2014 20:53:03 +0000 (12:53 -0800)
This only works for those which have specified a finisher in the MDR.

Signed-off-by: Greg Farnum <greg@inktank.com>
src/mds/Server.cc

index 315d036a7ac6d77cc8f9e9e676d5db2dc2a91ecc..a747959d82e03026430000d01a8cc4fd7faa8bcd 100644 (file)
@@ -903,7 +903,14 @@ void Server::submit_mdlog_entry(LogEvent *le, MDSInternalContextBase *fin, MDReq
  */
 void Server::respond_to_request(MDRequestRef& mdr, int r)
 {
-  reply_client_request(mdr, new MClientReply(mdr->client_request, r));
+  if (mdr->client_request) {
+    reply_client_request(mdr, new MClientReply(mdr->client_request, r));
+  } else if (mdr->internal_op > -1) {
+    dout(10) << "respond_to_request on internal request " << mdr << dendl;
+    if (!mdr->internal_op_finish)
+      assert(0 == "trying to respond to internal op without finisher");
+    mdr->internal_op_finish->complete(r);
+  }
 }
 
 void Server::early_reply(MDRequestRef& mdr, CInode *tracei, CDentry *tracedn)