aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2018-04-23 09:25:10 -0400
committerIlya Dryomov <idryomov@gmail.com>2018-04-24 04:39:52 -0400
commitfacb9f6eba3df4e8027301cc0e514dc582a1b366 (patch)
tree4ce7511344ce163230077874f505941966e42b16 /net
parentf1919826896c82b6af9c46f69e02f2bc04df4be7 (diff)
libceph: un-backoff on tick when we have a authenticated session
This means that if we do some backoff, then authenticate, and are healthy for an extended period of time, a subsequent failure won't leave us starting our hunting sequence with a large backoff. Mirrors ceph.git commit d466bc6e66abba9b464b0b69687cf45c9dccf383. Cc: stable@vger.kernel.org # 4.7+ Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Jason Dillaman <dillaman@redhat.com>
Diffstat (limited to 'net')
-rw-r--r--net/ceph/mon_client.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/net/ceph/mon_client.c b/net/ceph/mon_client.c
index b3dac24412d3..02c441c12c38 100644
--- a/net/ceph/mon_client.c
+++ b/net/ceph/mon_client.c
@@ -209,6 +209,14 @@ static void reopen_session(struct ceph_mon_client *monc)
209 __open_session(monc); 209 __open_session(monc);
210} 210}
211 211
212static void un_backoff(struct ceph_mon_client *monc)
213{
214 monc->hunt_mult /= 2; /* reduce by 50% */
215 if (monc->hunt_mult < 1)
216 monc->hunt_mult = 1;
217 dout("%s hunt_mult now %d\n", __func__, monc->hunt_mult);
218}
219
212/* 220/*
213 * Reschedule delayed work timer. 221 * Reschedule delayed work timer.
214 */ 222 */
@@ -963,6 +971,7 @@ static void delayed_work(struct work_struct *work)
963 if (!monc->hunting) { 971 if (!monc->hunting) {
964 ceph_con_keepalive(&monc->con); 972 ceph_con_keepalive(&monc->con);
965 __validate_auth(monc); 973 __validate_auth(monc);
974 un_backoff(monc);
966 } 975 }
967 976
968 if (is_auth && 977 if (is_auth &&
@@ -1123,9 +1132,7 @@ static void finish_hunting(struct ceph_mon_client *monc)
1123 dout("%s found mon%d\n", __func__, monc->cur_mon); 1132 dout("%s found mon%d\n", __func__, monc->cur_mon);
1124 monc->hunting = false; 1133 monc->hunting = false;
1125 monc->had_a_connection = true; 1134 monc->had_a_connection = true;
1126 monc->hunt_mult /= 2; /* reduce by 50% */ 1135 un_backoff(monc);
1127 if (monc->hunt_mult < 1)
1128 monc->hunt_mult = 1;
1129 } 1136 }
1130} 1137}
1131 1138