From: Yan, Zheng Date: Fri, 31 May 2013 08:37:11 +0000 (+0800) Subject: ceph: check migrate seq before changing auth cap X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b8c2f3ae2d9f2b975a0e1a9c5652829ef8a4f06c;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ceph: check migrate seq before changing auth cap We may receive old request reply from the exporter MDS after receiving the importer MDS' cap import message. Signed-off-by: Yan, Zheng Reviewed-by: Sage Weil --- diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 54c290b083ab..790f88b15daf 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -612,9 +612,11 @@ retry: __cap_delay_requeue(mdsc, ci); } - if (flags & CEPH_CAP_FLAG_AUTH) - ci->i_auth_cap = cap; - else if (ci->i_auth_cap == cap) { + if (flags & CEPH_CAP_FLAG_AUTH) { + if (ci->i_auth_cap == NULL || + ceph_seq_cmp(ci->i_auth_cap->mseq, mseq) < 0) + ci->i_auth_cap = cap; + } else if (ci->i_auth_cap == cap) { ci->i_auth_cap = NULL; spin_lock(&mdsc->cap_dirty_lock); if (!list_empty(&ci->i_dirty_item)) {