]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: fix message order check in handle_cap_export()
authorYan, Zheng <zyan@redhat.com>
Mon, 28 Aug 2017 09:13:31 +0000 (17:13 +0800)
committerYan, Zheng <zyan@redhat.com>
Tue, 29 Aug 2017 13:37:40 +0000 (21:37 +0800)
If importer mds' cap already exists, but cap ID mismatches, client
should have received corresponding import message (the imported caps
got released later). Because cap ID does not change as long as client
holds the caps.

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/client/Client.cc

index 4cfcb5ef5c502873bb4f2292c7f2e61d622ae3e9..b10df4e0da7b019d608ca2a60d5d08f51c86550b 100644 (file)
@@ -4771,7 +4771,7 @@ void Client::handle_cap_export(MetaSession *session, Inode *in, MClientCaps *m)
       MetaSession *tsession = _get_or_open_mds_session(peer_mds);
       if (in->caps.count(peer_mds)) {
        Cap *tcap = in->caps[peer_mds];
-       if (tcap->cap_id != m->peer.cap_id ||
+       if (tcap->cap_id == m->peer.cap_id &&
            ceph_seq_cmp(tcap->seq, m->peer.seq) < 0) {
          tcap->cap_id = m->peer.cap_id;
          tcap->seq = m->peer.seq - 1;