Whamcloud - gitweb
LU-1308 Properly add multihomed nids to peer table
authorOleg Drokin <green@whamcloud.com>
Tue, 17 Apr 2012 06:31:10 +0000 (02:31 -0400)
committerOleg Drokin <green@whamcloud.com>
Sun, 22 Apr 2012 09:01:54 +0000 (05:01 -0400)
class_add_uuid had a copy&paste error where it was checking against
wrong entry for nid tables and as such had trouble finding multihomed
nid configurations.

Change-Id: I2d73bdde9cf7b0bf882b14b473b4491873e64c25
Signed-off-by: Oleg Drokin <green@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/2561
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Mike Pershin <tappro@whamcloud.com>
lustre/obdclass/lustre_peer.c

index a8c26e3..014e714 100644 (file)
@@ -122,15 +122,15 @@ int class_add_uuid(const char *uuid, __u64 nid)
                         int i;
 
                         found = 1;
                         int i;
 
                         found = 1;
-                        for (i = 0; i < data->un_nid_count; i++)
+                        for (i = 0; i < entry->un_nid_count; i++)
                                 if (nid == entry->un_nids[i])
                                         break;
 
                                 if (nid == entry->un_nids[i])
                                         break;
 
-                        if (i == data->un_nid_count) {
-                                LASSERT(data->un_nid_count < NIDS_MAX);
-                                data->un_nids[++data->un_nid_count] = nid;
-                                break;
+                        if (i == entry->un_nid_count) {
+                                LASSERT(entry->un_nid_count < NIDS_MAX);
+                                entry->un_nids[++entry->un_nid_count] = nid;
                         }
                         }
+                        break;
                 }
         }
         if (!found)
                 }
         }
         if (!found)
@@ -213,6 +213,7 @@ int class_check_uuid(struct obd_uuid *uuid, __u64 nid)
                                 break;
                         }
                 }
                                 break;
                         }
                 }
+                break;
         }
         cfs_spin_unlock (&g_uuid_lock);
         RETURN(found);
         }
         cfs_spin_unlock (&g_uuid_lock);
         RETURN(found);