From abdaf98a6ae7a0e836c2700f0b019c9264207445 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 2 Sep 2011 20:46:53 -0700 Subject: [PATCH] client: only flush imported cap if it is now auth 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 --- src/client/Client.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 444e6df7179ea..c5fa15abf799b 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -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() -- 2.39.5