Whamcloud - gitweb
b=14238, i=liangzhen, i=maxim:
authorisaac <isaac>
Mon, 10 Dec 2007 09:08:20 +0000 (09:08 +0000)
committerisaac <isaac>
Mon, 10 Dec 2007 09:08:20 +0000 (09:08 +0000)
-   NULL md_me in lnet_md_unlink().
-   iterate ptl_ml safely since 'me' can be removed within the loop.

lnet/ChangeLog
lnet/lnet/lib-md.c
lnet/lnet/lib-me.c
lnet/lnet/lib-move.c

index cde316c..659d267 100644 (file)
@@ -29,6 +29,10 @@ tbd         Cluster File Systems, Inc. <info@clusterfs.com>
        ptllnd    - Portals 3.3 / UNICOS/lc 1.5.x, 2.0.x
 
 Severity   : normal
+Bugzilla   : 14238
+Description: ASSERTION(me == md->md_me) failed in lnet_match_md()
+
+Severity   : normal
 Bugzilla   : 12494
 Description: increase send queue size for ciblnd/openiblnd
 
index 57d92ae..ecd8f07 100644 (file)
@@ -39,6 +39,7 @@ lnet_md_unlink(lnet_libmd_t *md)
                 /* Disassociate from ME (if any), and unlink it if it was created
                  * with LNET_UNLINK */
                 if (me != NULL) {
+                        md->md_me = NULL;
                         me->me_md = NULL;
                         if (me->me_unlink == LNET_UNLINK)
                                 lnet_me_unlink(me);
index fb72c6d..865d2eb 100644 (file)
@@ -145,7 +145,7 @@ lnet_me_unlink(lnet_me_t *me)
 {
         list_del (&me->me_list);
 
-        if (me->me_md) {
+        if (me->me_md != NULL) {
                 me->me_md->md_me = NULL;
                 lnet_md_unlink(me->me_md);
         }
index 5f68818..817c898 100644 (file)
@@ -140,8 +140,8 @@ lnet_match_md(int index, int op_mask, lnet_process_id_t src,
               lnet_libmd_t **md_out)
 {
         lnet_portal_t    *ptl = &the_lnet.ln_portals[index];
-        struct list_head *tmp;
         lnet_me_t        *me;
+        lnet_me_t        *tmp;
         lnet_libmd_t     *md;
         int               rc;
 
@@ -154,11 +154,10 @@ lnet_match_md(int index, int op_mask, lnet_process_id_t src,
                 return LNET_MATCHMD_DROP;
         }
 
-        list_for_each (tmp, &ptl->ptl_ml) {
-                me = list_entry(tmp, lnet_me_t, me_list);
+        list_for_each_entry_safe (me, tmp, &ptl->ptl_ml, me_list) {
                 md = me->me_md;
 
-                 /* ME attached but MD not attached yet */
+                /* ME attached but MD not attached yet */
                 if (md == NULL)
                         continue;