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>
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()