From a511e19f5b9b734496be88be5552f49c2b9da1c0 Mon Sep 17 00:00:00 2001 From: sageweil Date: Thu, 26 Apr 2007 18:46:26 +0000 Subject: [PATCH] * mds: osdmap handling bugfix * 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 | 8 ++++++-- trunk/ceph/mds/MDS.cc | 19 ++++++++++--------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/trunk/ceph/common/Thread.h b/trunk/ceph/common/Thread.h index e7feb1765be93..43c5f57f4a96c 100644 --- a/trunk/ceph/common/Thread.h +++ b/trunk/ceph/common/Thread.h @@ -16,6 +16,7 @@ #define __THREAD_H #include +#include 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) diff --git a/trunk/ceph/mds/MDS.cc b/trunk/ceph/mds/MDS.cc index c27cc98214fa3..6d66b77cd95f2 100644 --- a/trunk/ceph/mds/MDS.cc +++ b/trunk/ceph/mds/MDS.cc @@ -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::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::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)); - } } -- 2.39.5