From: isaac Date: Wed, 4 Jul 2007 17:39:52 +0000 (+0000) Subject: i=eeb: X-Git-Tag: v1_7_100~33 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;ds=sidebyside;h=a64f43dfeb7b30b5f94cee813f57845c76feeeac;p=fs%2Flustre-release.git i=eeb: - check against LNET_PID_ANY in libcfs_id2str. - clear all lazy portals before lnet_clear_peer_table. --- diff --git a/lnet/ChangeLog b/lnet/ChangeLog index 4fac91f..aa6b8f4 100644 --- a/lnet/ChangeLog +++ b/lnet/ChangeLog @@ -13,6 +13,13 @@ ptllnd - Portals 3.3 / UNICOS/lc 1.5.x, 2.0.x * bug fixes +Severity : minor +Details : lnet_clear_peer_table can wait forever if user forgets to + clear a lazy portal. + +Severity : minor +Details : libcfs_id2str should check pid against LNET_PID_ANY. + Severity : major Bugzilla : 10916 Description: added LNET self test diff --git a/lnet/libcfs/nidstrings.c b/lnet/libcfs/nidstrings.c index 784a583..ae8794c 100644 --- a/lnet/libcfs/nidstrings.c +++ b/lnet/libcfs/nidstrings.c @@ -472,6 +472,12 @@ libcfs_id2str(lnet_process_id_t id) { char *str = libcfs_next_nidstring(); + if (id.pid == LNET_PID_ANY) { + snprintf(str, LNET_NIDSTR_SIZE, + "LNET_PID_ANY-%s", libcfs_nid2str(id.nid)); + return str; + } + snprintf(str, LNET_NIDSTR_SIZE, "%s%u-%s", ((id.pid & LNET_PID_USERFLAG) != 0) ? "U" : "", (id.pid & ~LNET_PID_USERFLAG), libcfs_nid2str(id.nid)); diff --git a/lnet/lnet/api-ni.c b/lnet/lnet/api-ni.c index f341cd8..5f5589c 100644 --- a/lnet/lnet/api-ni.c +++ b/lnet/lnet/api-ni.c @@ -713,8 +713,6 @@ lnet_unprepare (void) LASSERT (the_lnet.ln_nzombie_nis == 0); for (idx = 0; idx < the_lnet.ln_nportals; idx++) { - - LNetClearLazyPortal(idx); LASSERT (list_empty(&the_lnet.ln_portals[idx].ptl_msgq)); while (!list_empty (&the_lnet.ln_portals[idx].ptl_ml)) { @@ -904,9 +902,14 @@ lnet_shutdown_lndnis (void) } LNET_UNLOCK(); + + /* Clear lazy portals and drop delayed messages which hold refs + * on their lnet_msg_t::msg_rxpeer */ + for (i = 0; i < the_lnet.ln_nportals; i++) + LNetClearLazyPortal(i); + /* Clear the peer table and wait for all peers to go (they hold refs on * their NIs) */ - lnet_clear_peer_table(); LNET_LOCK(); diff --git a/lnet/lnet/lib-move.c b/lnet/lnet/lib-move.c index f598c0b..07d4a6c 100644 --- a/lnet/lnet/lib-move.c +++ b/lnet/lnet/lib-move.c @@ -1432,7 +1432,10 @@ LNetClearLazyPortal(int portal) return 0; } - CDEBUG(D_NET, "clearing portal %d lazy\n", portal); + if (the_lnet.ln_shutdown) + CWARN ("Active lazy portal %d on exit\n", portal); + else + CDEBUG (D_NET, "clearing portal %d lazy\n", portal); /* grab all the blocked messages atomically */ list_add(&zombies, &ptl->ptl_msgq); @@ -1619,7 +1622,7 @@ lnet_parse_put(lnet_ni_t *ni, lnet_msg_t *msg) case LNET_MATCHMD_NONE: rc = lnet_eager_recv_locked(msg); - if (rc == 0) { + if (rc == 0 && !the_lnet.ln_shutdown) { list_add_tail(&msg->msg_list, &the_lnet.ln_portals[index].ptl_msgq); @@ -1645,7 +1648,6 @@ lnet_parse_put(lnet_ni_t *ni, lnet_msg_t *msg) LNET_UNLOCK(); return ENOENT; /* +ve: OK but no match */ - } } @@ -2054,8 +2056,8 @@ lnet_parse(lnet_ni_t *ni, lnet_hdr_t *hdr, lnet_nid_t from_nid, msg = lnet_msg_alloc(); if (msg == NULL) { CERROR("%s, src %s: Dropping %s (out of memory)\n", - libcfs_nid2str(from_nid), libcfs_nid2str(src_nid) - , lnet_msgtyp2str(type)); + libcfs_nid2str(from_nid), libcfs_nid2str(src_nid), + lnet_msgtyp2str(type)); goto drop; } diff --git a/lnet/lnet/peer.c b/lnet/lnet/peer.c index 06b09b2..d4b58fa 100644 --- a/lnet/lnet/peer.c +++ b/lnet/lnet/peer.c @@ -185,6 +185,12 @@ lnet_nid2peer_locked(lnet_peer_t **lpp, lnet_nid_t nid) LIBCFS_FREE(lp, sizeof(*lp)); LNET_LOCK(); + if (the_lnet.ln_shutdown) { + lnet_peer_decref_locked(lp2); + *lpp = NULL; + return -ESHUTDOWN; + } + *lpp = lp2; return 0; }