[Ocfs2-commits] smushran commits r3091 - branches/ocfs2-1.2/fs/ocfs2/cluster
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Fri May 2 14:24:49 PDT 2008
Author: smushran
Date: 2008-05-02 14:24:49 -0700 (Fri, 02 May 2008)
New Revision: 3091
Modified:
branches/ocfs2-1.2/fs/ocfs2/cluster/tcp.c
Log:
ocfs2: Fix NULL pointer dereferences in o2net
Mainline commit cdef59a94c2fc962ada379d4240d556db7b56d55
Author: Tao Ma <tao.ma at oracle.com>
Date: Wed, 5 Mar 2008 15:49:55 +0800
In some situations, ocfs2_set_nn_state might get called with sc = NULL and
valid = 0. If sc = NULL, we can't dereference it to get the o2nm_node
member. Instead, do what o2net_initialize_handshake does and use NULL when
calling o2net_reconnect_delay and o2net_idle_timeout.
Signed-off-by: jlbec
Modified: branches/ocfs2-1.2/fs/ocfs2/cluster/tcp.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/cluster/tcp.c 2008-05-02 21:23:31 UTC (rev 3090)
+++ branches/ocfs2-1.2/fs/ocfs2/cluster/tcp.c 2008-05-02 21:24:49 UTC (rev 3091)
@@ -463,9 +463,9 @@
/* delay if we're withing a RECONNECT_DELAY of the
* last attempt */
delay = (nn->nn_last_connect_attempt +
- msecs_to_jiffies(o2net_reconnect_delay(sc->sc_node)))
+ msecs_to_jiffies(o2net_reconnect_delay(NULL)))
- jiffies;
- if (delay > msecs_to_jiffies(o2net_reconnect_delay(sc->sc_node)))
+ if (delay > msecs_to_jiffies(o2net_reconnect_delay(NULL)))
delay = 0;
mlog(ML_CONN, "queueing conn attempt in %lu jiffies\n", delay);
queue_delayed_work(o2net_wq, &nn->nn_connect_work, delay);
@@ -1563,12 +1563,11 @@
spin_lock(&nn->nn_lock);
if (!nn->nn_sc_valid) {
- struct o2nm_node *node = nn->nn_sc->sc_node;
mlog(ML_ERROR, "no connection established with node %u after "
"%u.%u seconds, giving up and returning errors.\n",
o2net_num_from_nn(nn),
- o2net_idle_timeout(node) / 1000,
- o2net_idle_timeout(node) % 1000);
+ o2net_idle_timeout(NULL) / 1000,
+ o2net_idle_timeout(NULL) % 1000);
o2net_set_nn_state(nn, NULL, 0, -ENOTCONN);
}
More information about the Ocfs2-commits
mailing list