diff options
author | Sage Weil <sage.weil@dreamhost.com> | 2011-09-02 20:46:53 -0700 |
---|---|---|
committer | Sage Weil <sage.weil@dreamhost.com> | 2011-09-02 20:46:53 -0700 |
commit | abdaf98a6ae7a0e836c2700f0b019c9264207445 (patch) | |
tree | 2ed4600d4e53b9cea02934da6caf498238c45b4a | |
parent | bd4a2475905e653c9fb7a0cba226d54dedc14be0 (diff) | |
download | ceph-abdaf98a6ae7a0e836c2700f0b019c9264207445.tar.gz |
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 <sage.weil@dreamhost.com>
-rw-r--r-- | src/client/Client.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/client/Client.cc b/src/client/Client.cc index 444e6df7179..c5fa15abf79 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() |