]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: only flush imported cap if it is now auth
authorSage Weil <sage.weil@dreamhost.com>
Sat, 3 Sep 2011 03:46:53 +0000 (20:46 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Sat, 3 Sep 2011 03:46:53 +0000 (20:46 -0700)
We can get a cap import that isn't auth if there was a racing import
because the cap since migrated to another node.  We do not want to flush
the caps in that case.  Not to this mds, certainly, and not even to
another, because that would have happened when we got the other import.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/client/Client.cc

index 444e6df7179eaa493f9952578bb515fe34367ae8..c5fa15abf799b94f7a02b7e94a7334769213c093 100644 (file)
@@ -2948,11 +2948,13 @@ void Client::handle_cap_import(Inode *in, MClientCaps *m)
                 m->get_caps(), m->get_seq(), m->get_mseq(), m->get_realm(),
                 CEPH_CAP_FLAG_AUTH);
   
-  // reflush any/all caps
-  if (in->cap_snaps.size())
-    flush_snaps(in, true);
-  if (in->flushing_caps)
-    flush_caps(in, mds);
+  if (in->auth_cap && in->auth_cap->session->mds_num == mds) {
+    // reflush any/all caps (if we are now the auth_cap)
+    if (in->cap_snaps.size())
+      flush_snaps(in, true);
+    if (in->flushing_caps)
+      flush_caps(in, mds);
+  }
 
   if (m->get_mseq() > in->exporting_mseq) {
     ldout(cct, 5) << "handle_cap_import ino " << m->get_ino() << " mseq " << m->get_mseq()