ceph: fix message order check in handle_cap_export()
authorYan, Zheng <zyan@redhat.com>
Mon, 28 Aug 2017 07:07:42 +0000 (15:07 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 6 Sep 2017 17:56:53 +0000 (19:56 +0200)
If caps for importer mds exists, but cap id mismatch, client should
have received corresponding import message. Because cap ID does not
change as long as client holds the caps.

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/caps.c

index 5daf86621871b921debd4e26772bca65ff8bac7d..7a79450328026e462feb449b80b90febd66c99c8 100644 (file)
@@ -3427,7 +3427,7 @@ retry:
        tcap = __get_cap_for_mds(ci, target);
        if (tcap) {
                /* already have caps from the target */
-               if (tcap->cap_id != t_cap_id ||
+               if (tcap->cap_id == t_cap_id &&
                    ceph_seq_cmp(tcap->seq, t_seq) < 0) {
                        dout(" updating import cap %p mds%d\n", tcap, target);
                        tcap->cap_id = t_cap_id;