]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
MDCache: "handle" request_forward on internal ops
authorGreg Farnum <greg@inktank.com>
Wed, 27 Aug 2014 21:11:26 +0000 (14:11 -0700)
committerGreg Farnum <gfarnum@redhat.com>
Fri, 7 Nov 2014 20:42:15 +0000 (12:42 -0800)
For now, just return -EXDEV ("Cross-device link") on internal ops that
require forwarding, as forwarding internal ops will require a great deal more
infrastructure.. But push the issue down to this level instead of worrying
about it in path_traverse, and consider the possibility that the MDRequest
might not have a client_request that it's wrapped around.

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

index c52a90b8b3a483c5ea6714a3ba16b74eb237d1bb..0d44e36678caf651d67fbbbdbee136aa3a894a0d 100644 (file)
@@ -8447,12 +8447,15 @@ void MDCache::request_finish(MDRequestRef& mdr)
 void MDCache::request_forward(MDRequestRef& mdr, int who, int port)
 {
   mdr->mark_event("forwarding request");
-  if (mdr->client_request->get_source().is_client()) {
+  if (mdr->client_request && mdr->client_request->get_source().is_client()) {
     dout(7) << "request_forward " << *mdr << " to mds." << who << " req "
             << *mdr->client_request << dendl;
     mds->forward_message_mds(mdr->client_request, who);
     mdr->client_request = 0;
     if (mds->logger) mds->logger->inc(l_mds_forward);
+  } else if (mdr->internal_op >= 0) {
+    dout(10) << "request_forward on internal op; cancelling" << dendl;
+    mdr->internal_op_finish->complete(-EXDEV);
   } else {
     dout(7) << "request_forward drop " << *mdr << " req " << *mdr->client_request
             << " was from mds" << dendl;