summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAlex Elder2012-10-09 05:37:30 +0200
committerAlex Elder2012-10-10 07:00:21 +0200
commit8618e30bc14b06bfafa0f164cca7b0e06451f88a (patch)
tree255279320cdbd2f82d48973d11183a2bdb929044 /net
parentrbd: reset BACKOFF if unable to re-queue (diff)
downloadkernel-qcow2-linux-8618e30bc14b06bfafa0f164cca7b0e06451f88a.tar.gz
kernel-qcow2-linux-8618e30bc14b06bfafa0f164cca7b0e06451f88a.tar.xz
kernel-qcow2-linux-8618e30bc14b06bfafa0f164cca7b0e06451f88a.zip
rbd: let con_work() handle backoff
Both ceph_fault() and con_work() include handling for imposing a delay before doing further processing on a faulted connection. The latter is used only if ceph_fault() is unable to. Instead, just let con_work() always be responsible for implementing the delay. After setting up the delay value, set the BACKOFF flag on the connection unconditionally and call queue_con() to ensure con_work() will get called to handle it. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net')
-rw-r--r--net/ceph/messenger.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index cad0d17ec45e..973c16c20c42 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -2398,24 +2398,8 @@ static void ceph_fault(struct ceph_connection *con)
con->delay = BASE_DELAY_INTERVAL;
else if (con->delay < MAX_DELAY_INTERVAL)
con->delay *= 2;
- con->ops->get(con);
- if (queue_delayed_work(ceph_msgr_wq, &con->work,
- round_jiffies_relative(con->delay))) {
- dout("fault queued %p delay %lu\n", con, con->delay);
- } else {
- con->ops->put(con);
- dout("fault failed to queue %p delay %lu, backoff\n",
- con, con->delay);
- /*
- * In many cases we see a socket state change
- * while con_work is running and end up
- * queuing (non-delayed) work, such that we
- * can't backoff with a delay. Set a flag so
- * that when con_work restarts we schedule the
- * delay then.
- */
- set_bit(CON_FLAG_BACKOFF, &con->flags);
- }
+ set_bit(CON_FLAG_BACKOFF, &con->flags);
+ queue_con(con);
}
out_unlock: