From: Yan, Zheng Date: Mon, 28 Aug 2017 07:07:42 +0000 (+0800) Subject: ceph: fix message order check in handle_cap_export() X-Git-Tag: v4.14-rc1~47^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fa0aa3b839b922c7bb911dbe2435da2a4e59d82d;p=thirdparty%2Fkernel%2Flinux.git ceph: fix message order check in handle_cap_export() 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" Signed-off-by: Ilya Dryomov --- diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 5daf86621871b..7a79450328026 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -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;