aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ceph/mds_client.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 866e8d7ca37d..89971e137aab 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -402,7 +402,7 @@ static struct ceph_mds_session *register_session(struct ceph_mds_client *mdsc,
402 402
403 spin_lock_init(&s->s_gen_ttl_lock); 403 spin_lock_init(&s->s_gen_ttl_lock);
404 s->s_cap_gen = 0; 404 s->s_cap_gen = 0;
405 s->s_cap_ttl = 0; 405 s->s_cap_ttl = jiffies - 1;
406 406
407 spin_lock_init(&s->s_cap_lock); 407 spin_lock_init(&s->s_cap_lock);
408 s->s_renew_requested = 0; 408 s->s_renew_requested = 0;
@@ -1083,8 +1083,7 @@ static void renewed_caps(struct ceph_mds_client *mdsc,
1083 int wake = 0; 1083 int wake = 0;
1084 1084
1085 spin_lock(&session->s_cap_lock); 1085 spin_lock(&session->s_cap_lock);
1086 was_stale = is_renew && (session->s_cap_ttl == 0 || 1086 was_stale = is_renew && time_after_eq(jiffies, session->s_cap_ttl);
1087 time_after_eq(jiffies, session->s_cap_ttl));
1088 1087
1089 session->s_cap_ttl = session->s_renew_requested + 1088 session->s_cap_ttl = session->s_renew_requested +
1090 mdsc->mdsmap->m_session_timeout*HZ; 1089 mdsc->mdsmap->m_session_timeout*HZ;
@@ -2332,7 +2331,7 @@ static void handle_session(struct ceph_mds_session *session,
2332 session->s_mds); 2331 session->s_mds);
2333 spin_lock(&session->s_gen_ttl_lock); 2332 spin_lock(&session->s_gen_ttl_lock);
2334 session->s_cap_gen++; 2333 session->s_cap_gen++;
2335 session->s_cap_ttl = 0; 2334 session->s_cap_ttl = jiffies - 1;
2336 spin_unlock(&session->s_gen_ttl_lock); 2335 spin_unlock(&session->s_gen_ttl_lock);
2337 send_renew_caps(mdsc, session); 2336 send_renew_caps(mdsc, session);
2338 break; 2337 break;