[Ocfs2-commits] smushran commits r2973 -
branches/ocfs2-1.2/fs/ocfs2/dlm
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Mon Jan 29 14:26:25 PST 2007
Author: smushran
Date: 2007-01-29 14:26:24 -0800 (Mon, 29 Jan 2007)
New Revision: 2973
Modified:
branches/ocfs2-1.2/fs/ocfs2/dlm/dlmdomain.c
Log:
ocfs2_dlm: Add timeout to dlm join domain
Currently dlm has no timeout during dlm join domain. While this is
not a problem in normal operation, this does become an issue if, say,
the other node is refusing to let the node join the domain because
of a stuck recovery. This patch adds a 90 sec timeout.
Signed-off-by: mfasheh
Modified: branches/ocfs2-1.2/fs/ocfs2/dlm/dlmdomain.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/dlm/dlmdomain.c 2007-01-29 22:24:16 UTC (rev 2972)
+++ branches/ocfs2-1.2/fs/ocfs2/dlm/dlmdomain.c 2007-01-29 22:26:24 UTC (rev 2973)
@@ -1246,6 +1246,8 @@
static int dlm_join_domain(struct dlm_ctxt *dlm)
{
int status;
+ unsigned int backoff;
+ unsigned int tot_backoff = 0;
BUG_ON(!dlm);
@@ -1277,18 +1279,27 @@
}
do {
- unsigned int backoff;
status = dlm_try_to_join_domain(dlm);
/* If we're racing another node to the join, then we
* need to back off temporarily and let them
* complete. */
+#define DLM_JOIN_TIMEOUT_MSECS 90000
if (status == -EAGAIN) {
if (signal_pending(current)) {
status = -ERESTARTSYS;
goto bail;
}
+ if (tot_backoff >
+ msecs_to_jiffies(DLM_JOIN_TIMEOUT_MSECS)) {
+ status = -ERESTARTSYS;
+ mlog(ML_NOTICE, "Timed out joining dlm domain "
+ "%s after %u msecs\n", dlm->name,
+ jiffies_to_msecs(tot_backoff));
+ goto bail;
+ }
+
/*
* <chip> After you!
* <dale> No, after you!
@@ -1298,6 +1309,7 @@
*/
backoff = (unsigned int)(jiffies & 0x3);
backoff *= DLM_DOMAIN_BACKOFF_MS;
+ tot_backoff += backoff;
mlog(0, "backoff %d\n", backoff);
msleep(backoff);
}
More information about the Ocfs2-commits
mailing list