]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
* mds: osdmap handling bugfix
authorsageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Thu, 26 Apr 2007 18:46:26 +0000 (18:46 +0000)
committersageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Thu, 26 Apr 2007 18:46:26 +0000 (18:46 +0000)
* common/Thread.h: fixed stupid join() problem (again)

git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1349 29311d96-e01e-0410-9327-a35deaab8ce9

trunk/ceph/common/Thread.h
trunk/ceph/mds/MDS.cc

index e7feb1765be93995e9e2d32d12eda5de4fff75c3..43c5f57f4a96c4fbfa9bb5cc189a6a3483863a87 100644 (file)
@@ -16,6 +16,7 @@
 #define __THREAD_H
 
 #include <pthread.h>
+#include <errno.h>
 
 class Thread {
  private:
@@ -45,8 +46,11 @@ class Thread {
   }
 
   int join(void **prval = 0) {
-    //assert(thread_id);  // for now
-    //if (thread_id == 0) return -1;   // never started.
+    if (thread_id == 0) {
+      cerr << "WARNING: join on thread that was never started" << endl;
+      //assert(0);
+      return -EINVAL;   // never started.
+    }
 
     int status = pthread_join(thread_id, prval);
     if (status == 0) 
index c27cc98214fa3b9d23e688e78bd34d5d5b35c575..6d66b77cd95f23b634120c1d3b1abacdabcd852e 100644 (file)
@@ -573,6 +573,16 @@ void MDS::handle_osd_map(MOSDMap *m)
   
   dout(10) << "handle_osd_map had " << had << endl;
 
+  // pass on to clients
+  for (set<int>::iterator it = clientmap.get_mount_set().begin();
+       it != clientmap.get_mount_set().end();
+       it++) {
+    MOSDMap *n = new MOSDMap;
+    n->maps = m->maps;
+    n->incremental_maps = m->incremental_maps;
+    messenger->send_message(n, clientmap.get_inst(*it));
+  }
+
   // process locally
   objecter->handle_osd_map(m);
 
@@ -587,15 +597,6 @@ void MDS::handle_osd_map(MOSDMap *m)
       assert(is_standby());
   }  
   
-  // pass on to clients
-  for (set<int>::iterator it = clientmap.get_mount_set().begin();
-       it != clientmap.get_mount_set().end();
-       it++) {
-    MOSDMap *n = new MOSDMap;
-    n->maps = m->maps;
-    n->incremental_maps = m->incremental_maps;
-    messenger->send_message(n, clientmap.get_inst(*it));
-  }
 }