aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/caps.c
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2013-05-31 04:37:11 -0400
committerSage Weil <sage@inktank.com>2013-07-03 18:32:48 -0400
commitb8c2f3ae2d9f2b975a0e1a9c5652829ef8a4f06c (patch)
tree8b96ef32548d08a4829f001ec0be4d80c0abdd6d /fs/ceph/caps.c
parentfc2744aa12da7182509b1059aa3ab53754d0c83a (diff)
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 <zheng.z.yan@intel.com> Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'fs/ceph/caps.c')
-rw-r--r--fs/ceph/caps.c8
1 files changed, 5 insertions, 3 deletions
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:
612 __cap_delay_requeue(mdsc, ci); 612 __cap_delay_requeue(mdsc, ci);
613 } 613 }
614 614
615 if (flags & CEPH_CAP_FLAG_AUTH) 615 if (flags & CEPH_CAP_FLAG_AUTH) {
616 ci->i_auth_cap = cap; 616 if (ci->i_auth_cap == NULL ||
617 else if (ci->i_auth_cap == cap) { 617 ceph_seq_cmp(ci->i_auth_cap->mseq, mseq) < 0)
618 ci->i_auth_cap = cap;
619 } else if (ci->i_auth_cap == cap) {
618 ci->i_auth_cap = NULL; 620 ci->i_auth_cap = NULL;
619 spin_lock(&mdsc->cap_dirty_lock); 621 spin_lock(&mdsc->cap_dirty_lock);
620 if (!list_empty(&ci->i_dirty_item)) { 622 if (!list_empty(&ci->i_dirty_item)) {