summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2016-01-22 12:42:17 -0500
committerIlya Dryomov <idryomov@gmail.com>2016-03-25 13:51:40 -0400
commitbee3a37c470e4febcb05556ceafcb70929268edd (patch)
tree3a37b82da1d64f3c0bf00a1305d9f8b3909ee42e
parent1752b50ca240a7f722f57e81ba04496eb15c466f (diff)
libceph: reschedule tick in mon_fault()
Doing __schedule_delayed() in the hunting branch is pointless, as the tick will have already been scheduled by then. What we need to do instead is *reschedule* it in the !hunting branch, after reopen_session() changes hunt_mult, which affects the delay. This helps with spacing out connection attempts and avoiding things like two back-to-back attempts followed by a longer period of waiting around. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
-rw-r--r--net/ceph/mon_client.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ceph/mon_client.c b/net/ceph/mon_client.c
index 816fb813a336..a2b45cf79dca 100644
--- a/net/ceph/mon_client.c
+++ b/net/ceph/mon_client.c
@@ -222,8 +222,8 @@ static void __schedule_delayed(struct ceph_mon_client *monc)
222 delay = CEPH_MONC_PING_INTERVAL; 222 delay = CEPH_MONC_PING_INTERVAL;
223 223
224 dout("__schedule_delayed after %lu\n", delay); 224 dout("__schedule_delayed after %lu\n", delay);
225 schedule_delayed_work(&monc->delayed_work, 225 mod_delayed_work(system_wq, &monc->delayed_work,
226 round_jiffies_relative(delay)); 226 round_jiffies_relative(delay));
227} 227}
228 228
229const char *ceph_sub_str[] = { 229const char *ceph_sub_str[] = {
@@ -1166,9 +1166,9 @@ static void mon_fault(struct ceph_connection *con)
1166 if (!monc->hunting) { 1166 if (!monc->hunting) {
1167 dout("%s hunting for new mon\n", __func__); 1167 dout("%s hunting for new mon\n", __func__);
1168 reopen_session(monc); 1168 reopen_session(monc);
1169 } else {
1170 /* already hunting, let's wait a bit */
1171 __schedule_delayed(monc); 1169 __schedule_delayed(monc);
1170 } else {
1171 dout("%s already hunting\n", __func__);
1172 } 1172 }
1173out: 1173out:
1174 mutex_unlock(&monc->mutex); 1174 mutex_unlock(&monc->mutex);