]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: call handle_cap_grant() for cap import message
authorYan, Zheng <zheng.z.yan@intel.com>
Thu, 20 Feb 2014 06:59:46 +0000 (14:59 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Thu, 27 Feb 2014 03:59:59 +0000 (11:59 +0800)
If client sends cap message that requests new max size during
exporting caps, the exporting MDS will drop the message quietly.
So the client may wait for the reply that updates the max size
forever. call handle_cap_grant() for cap import message can
avoid this issue.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/client/Client.cc

index 744a38a9a49f0f2a84b2b6000c632d0ce052d5ae..9975e45c99224359ee5f1dd9e83d5ee5cdf3999d 100644 (file)
@@ -3441,9 +3441,12 @@ void Client::handle_caps(MClientCaps *m)
   }
 
   switch (m->get_op()) {
-  case CEPH_CAP_OP_IMPORT: return handle_cap_import(session, in, m);
-  case CEPH_CAP_OP_EXPORT: return handle_cap_export(session, in, m);
-  case CEPH_CAP_OP_FLUSHSNAP_ACK: return handle_cap_flushsnap_ack(session, in, m);
+  case CEPH_CAP_OP_EXPORT:
+    return handle_cap_export(session, in, m);
+  case CEPH_CAP_OP_FLUSHSNAP_ACK:
+    return handle_cap_flushsnap_ack(session, in, m);
+  case CEPH_CAP_OP_IMPORT:
+    handle_cap_import(session, in, m);
   }
 
   if (in->caps.count(mds) == 0) {
@@ -3456,6 +3459,7 @@ void Client::handle_caps(MClientCaps *m)
 
   switch (m->get_op()) {
   case CEPH_CAP_OP_TRUNC: return handle_cap_trunc(session, in, m);
+  case CEPH_CAP_OP_IMPORT:
   case CEPH_CAP_OP_REVOKE:
   case CEPH_CAP_OP_GRANT: return handle_cap_grant(session, in, cap, m);
   case CEPH_CAP_OP_FLUSH_ACK: return handle_cap_flush_ack(session, in, cap, m);
@@ -3496,7 +3500,6 @@ void Client::handle_cap_import(MetaSession *session, Inode *in, MClientCaps *m)
            << ", keeping exporting_issued " << ccap_string(in->exporting_issued) 
            << " mseq " << in->exporting_mseq << " by mds." << in->exporting_mds << dendl;
   }
-  m->put();
 }
 
 void Client::handle_cap_export(MetaSession *session, Inode *in, MClientCaps *m)