[Ocfs2-devel] [PATCH 3/3] o2net: correct keepalive message protocol (revision 2)
Srinivas Eeda
srinivas.eeda at oracle.com
Thu Feb 18 15:11:49 PST 2010
Currently keepalive packet is sent to another node if a message is not heard
from the other node for O2NET_KEEPALIVE_DELAY_MS seconds. The message is not
resent again till the other node sends a message.
The functionality described above works as we rely on TCP protocol which
guarantees message delivery. However the intention of this feature was to send
a keepalive message every timeout seconds. This patch sends a message for
every keepalive time interval.
Signed-off-by: Srinivas Eeda <srinivas.eeda at oracle.com>
---
fs/ocfs2/cluster/tcp.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
index 0bbd47b..0b68f25 100644
--- a/fs/ocfs2/cluster/tcp.c
+++ b/fs/ocfs2/cluster/tcp.c
@@ -1473,7 +1473,11 @@ static void o2net_sc_send_keep_req(struct work_struct *work)
container_of(work, struct o2net_sock_container,
sc_keepalive_work.work);
- o2net_sendpage(sc, o2net_keep_req, sizeof(*o2net_keep_req));
+ if (timer_pending(&sc->sc_idle_timeout)) {
+ o2net_sendpage(sc, o2net_keep_req, sizeof(*o2net_keep_req));
+ o2net_sc_queue_delayed_work(sc, &sc->sc_keepalive_work,
+ msecs_to_jiffies(o2net_keepalive_delay()));
+ }
sc_put(sc);
}
--
1.5.6.5
More information about the Ocfs2-devel
mailing list