aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2009-11-10 19:02:23 -0500
committerSage Weil <sage@newdream.net>2009-11-10 19:03:53 -0500
commitcdac830313fa6bf2831693af80fefe4aaac11b7d (patch)
treecf5004237a084779ca84130c3303e42e9ea9fa35 /fs
parenteed0ef2caf928327332da54d23579debe629d5bc (diff)
ceph: remove recon_gen logic
We don't get an explicit affirmative confirmation that our caps reconnect, nor do we necessarily want to pay that cost. So, take all this code out for now. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs')
-rw-r--r--fs/ceph/caps.c12
-rw-r--r--fs/ceph/mds_client.c15
-rw-r--r--fs/ceph/mds_client.h2
-rw-r--r--fs/ceph/super.h1
4 files changed, 2 insertions, 28 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 775e6f6fc97..d8132b6e770 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -610,7 +610,6 @@ retry:
610 cap->issue_seq = seq; 610 cap->issue_seq = seq;
611 cap->mseq = mseq; 611 cap->mseq = mseq;
612 cap->cap_gen = session->s_cap_gen; 612 cap->cap_gen = session->s_cap_gen;
613 cap->recon_gen = session->s_recon_gen;
614 613
615 if (fmode >= 0) 614 if (fmode >= 0)
616 __ceph_get_fmode(ci, fmode); 615 __ceph_get_fmode(ci, fmode);
@@ -627,21 +626,13 @@ retry:
627static int __cap_is_valid(struct ceph_cap *cap) 626static int __cap_is_valid(struct ceph_cap *cap)
628{ 627{
629 unsigned long ttl; 628 unsigned long ttl;
630 u32 gen, recon_gen; 629 u32 gen;
631 630
632 spin_lock(&cap->session->s_cap_lock); 631 spin_lock(&cap->session->s_cap_lock);
633 gen = cap->session->s_cap_gen; 632 gen = cap->session->s_cap_gen;
634 recon_gen = cap->session->s_recon_gen;
635 ttl = cap->session->s_cap_ttl; 633 ttl = cap->session->s_cap_ttl;
636 spin_unlock(&cap->session->s_cap_lock); 634 spin_unlock(&cap->session->s_cap_lock);
637 635
638 if (cap->recon_gen != recon_gen) {
639 dout("__cap_is_valid %p cap %p issued %s "
640 "but DEAD (recon_gen %u vs %u)\n", &cap->ci->vfs_inode,
641 cap, ceph_cap_string(cap->issued), cap->recon_gen,
642 recon_gen);
643 return 0;
644 }
645 if (cap->cap_gen < gen || time_after_eq(jiffies, ttl)) { 636 if (cap->cap_gen < gen || time_after_eq(jiffies, ttl)) {
646 dout("__cap_is_valid %p cap %p issued %s " 637 dout("__cap_is_valid %p cap %p issued %s "
647 "but STALE (gen %u vs %u)\n", &cap->ci->vfs_inode, 638 "but STALE (gen %u vs %u)\n", &cap->ci->vfs_inode,
@@ -2213,7 +2204,6 @@ restart:
2213 issued |= implemented | __ceph_caps_dirty(ci); 2204 issued |= implemented | __ceph_caps_dirty(ci);
2214 2205
2215 cap->cap_gen = session->s_cap_gen; 2206 cap->cap_gen = session->s_cap_gen;
2216 cap->recon_gen = session->s_recon_gen;
2217 2207
2218 __check_cap_issue(ci, cap, newcaps); 2208 __check_cap_issue(ci, cap, newcaps);
2219 2209
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 828417ae16f..aad10d90fee 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -329,7 +329,6 @@ static struct ceph_mds_session *register_session(struct ceph_mds_client *mdsc,
329 ceph_con_open(&s->s_con, ceph_mdsmap_get_addr(mdsc->mdsmap, mds)); 329 ceph_con_open(&s->s_con, ceph_mdsmap_get_addr(mdsc->mdsmap, mds));
330 330
331 spin_lock_init(&s->s_cap_lock); 331 spin_lock_init(&s->s_cap_lock);
332 s->s_recon_gen = 0;
333 s->s_cap_gen = 0; 332 s->s_cap_gen = 0;
334 s->s_cap_ttl = 0; 333 s->s_cap_ttl = 0;
335 s->s_renew_requested = 0; 334 s->s_renew_requested = 0;
@@ -736,25 +735,14 @@ static void remove_session_caps(struct ceph_mds_session *session)
736static int wake_up_session_cb(struct inode *inode, struct ceph_cap *cap, 735static int wake_up_session_cb(struct inode *inode, struct ceph_cap *cap,
737 void *arg) 736 void *arg)
738{ 737{
739 struct ceph_mds_session *session = arg;
740
741 spin_lock(&inode->i_lock);
742 if (cap->recon_gen != session->s_recon_gen) {
743 pr_err("failed reconnect %p %llx.%llx cap %p "
744 "(recon_gen %d < session %d)\n", inode,
745 ceph_vinop(inode), cap,
746 cap->recon_gen, session->s_recon_gen);
747 __ceph_remove_cap(cap, NULL);
748 }
749 wake_up(&ceph_inode(inode)->i_cap_wq); 738 wake_up(&ceph_inode(inode)->i_cap_wq);
750 spin_unlock(&inode->i_lock);
751 return 0; 739 return 0;
752} 740}
753 741
754static void wake_up_session_caps(struct ceph_mds_session *session) 742static void wake_up_session_caps(struct ceph_mds_session *session)
755{ 743{
756 dout("wake_up_session_caps %p mds%d\n", session, session->s_mds); 744 dout("wake_up_session_caps %p mds%d\n", session, session->s_mds);
757 iterate_session_caps(session, wake_up_session_cb, session); 745 iterate_session_caps(session, wake_up_session_cb, NULL);
758} 746}
759 747
760/* 748/*
@@ -2052,7 +2040,6 @@ static void send_mds_reconnect(struct ceph_mds_client *mdsc, int mds)
2052 2040
2053 session->s_state = CEPH_MDS_SESSION_RECONNECTING; 2041 session->s_state = CEPH_MDS_SESSION_RECONNECTING;
2054 session->s_seq = 0; 2042 session->s_seq = 0;
2055 session->s_recon_gen++;
2056 2043
2057 ceph_con_open(&session->s_con, 2044 ceph_con_open(&session->s_con,
2058 ceph_mdsmap_get_addr(mdsc->mdsmap, mds)); 2045 ceph_mdsmap_get_addr(mdsc->mdsmap, mds));
diff --git a/fs/ceph/mds_client.h b/fs/ceph/mds_client.h
index c0846b1c482..f566e9c8429 100644
--- a/fs/ceph/mds_client.h
+++ b/fs/ceph/mds_client.h
@@ -98,8 +98,6 @@ struct ceph_mds_session {
98 u64 s_seq; /* incoming msg seq # */ 98 u64 s_seq; /* incoming msg seq # */
99 struct mutex s_mutex; /* serialize session messages */ 99 struct mutex s_mutex; /* serialize session messages */
100 100
101 int s_recon_gen; /* inc on reconnect to recovered mds */
102
103 struct ceph_connection s_con; 101 struct ceph_connection s_con;
104 102
105 /* protected by s_cap_lock */ 103 /* protected by s_cap_lock */
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index 25793559a2e..06b62c02f51 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -171,7 +171,6 @@ struct ceph_cap {
171 int mds_wanted; 171 int mds_wanted;
172 u32 seq, issue_seq, mseq; 172 u32 seq, issue_seq, mseq;
173 u32 cap_gen; /* active/stale cycle */ 173 u32 cap_gen; /* active/stale cycle */
174 u32 recon_gen; /* mds restart reconnect cycle */
175 unsigned long last_used; 174 unsigned long last_used;
176 struct list_head caps_item; 175 struct list_head caps_item;
177}; 176};