diff options
-rw-r--r-- | fs/ocfs2/cluster/tcp.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c index 9aa426e42123..92de96cd247d 100644 --- a/fs/ocfs2/cluster/tcp.c +++ b/fs/ocfs2/cluster/tcp.c | |||
@@ -355,6 +355,7 @@ static void sc_kref_release(struct kref *kref) | |||
355 | sc->sc_sock = NULL; | 355 | sc->sc_sock = NULL; |
356 | } | 356 | } |
357 | 357 | ||
358 | o2nm_undepend_item(&sc->sc_node->nd_item); | ||
358 | o2nm_node_put(sc->sc_node); | 359 | o2nm_node_put(sc->sc_node); |
359 | sc->sc_node = NULL; | 360 | sc->sc_node = NULL; |
360 | 361 | ||
@@ -376,6 +377,7 @@ static struct o2net_sock_container *sc_alloc(struct o2nm_node *node) | |||
376 | { | 377 | { |
377 | struct o2net_sock_container *sc, *ret = NULL; | 378 | struct o2net_sock_container *sc, *ret = NULL; |
378 | struct page *page = NULL; | 379 | struct page *page = NULL; |
380 | int status = 0; | ||
379 | 381 | ||
380 | page = alloc_page(GFP_NOFS); | 382 | page = alloc_page(GFP_NOFS); |
381 | sc = kzalloc(sizeof(*sc), GFP_NOFS); | 383 | sc = kzalloc(sizeof(*sc), GFP_NOFS); |
@@ -386,6 +388,13 @@ static struct o2net_sock_container *sc_alloc(struct o2nm_node *node) | |||
386 | o2nm_node_get(node); | 388 | o2nm_node_get(node); |
387 | sc->sc_node = node; | 389 | sc->sc_node = node; |
388 | 390 | ||
391 | /* pin the node item of the remote node */ | ||
392 | status = o2nm_depend_item(&node->nd_item); | ||
393 | if (status) { | ||
394 | mlog_errno(status); | ||
395 | o2nm_node_put(node); | ||
396 | goto out; | ||
397 | } | ||
389 | INIT_WORK(&sc->sc_connect_work, o2net_sc_connect_completed); | 398 | INIT_WORK(&sc->sc_connect_work, o2net_sc_connect_completed); |
390 | INIT_WORK(&sc->sc_rx_work, o2net_rx_until_empty); | 399 | INIT_WORK(&sc->sc_rx_work, o2net_rx_until_empty); |
391 | INIT_WORK(&sc->sc_shutdown_work, o2net_shutdown_sc); | 400 | INIT_WORK(&sc->sc_shutdown_work, o2net_shutdown_sc); |