Fix ceph-mds --journal-reset
PATCH 1/1 Fix ceph-mds --journal-reset
Complete configuration initialization for special actions, and hold Resetter lock while running reset.
Signed-off-by Alexandre Oliva <[email protected]>
--- src/ceph_mds.cc | 1 + src/mds/Resetter.cc | 2 ++ 2 files changed, 3 insertions(+), 0 deletions(-)
src/ceph_mds.cc +1 -0
@@ -65,6 +65,7 @@ void usage() static int do_cmds_special_action(const std::string &action, const std::string &dump_file, int rank) { + common_init_finish(g_ceph_context); SimpleMessenger *messenger = new SimpleMessenger(g_ceph_context); int r = messenger->bind(g_conf->public_addr, getpid()); if (r < 0)
src/mds/Resetter.cc +2 -0
@@ -83,6 +83,7 @@ void Resetter::reset() bool done; int r; + this->lock.Lock(); lock.Lock(); journaler->recover(new C_SafeCond(&lock, &cond, &done, &r)); while (!done)
@@ -142,5 +143,6 @@ void Resetter::reset() cout << "done" << std::endl; + this->lock.Unlock(); shutdown(); }
Signature · 7 lines
1.7.7.6 -- Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free Software Evangelist Red Hat Brazil Compiler Engineer
Hey-
Can you look at the wip-mds-resetter branch? I think that is closer to the correct locking. We need to hold the mutex for ms_dispatch (teh calls into objecter in particular), and to drop it when we block...
Thanks!
sage
Quoted 54 lines · Alexandre Oliva
Complete configuration initialization for special actions, and hold Resetter lock while running reset.
Signed-off-by Alexandre Oliva <[email protected]>--- src/ceph_mds.cc | 1 + src/mds/Resetter.cc | 2 ++ 2 files changed, 3 insertions(+), 0 deletions(-)src/ceph_mds.cc +1
-0@@ -65,6 +65,7 @@ void usage() static int do_cmds_special_action(const std::string &action, const std::string &dump_file, int rank) { + common_init_finish(g_ceph_context); SimpleMessenger *messenger = new SimpleMessenger(g_ceph_context); int r = messenger->bind(g_conf->public_addr, getpid()); if (r < 0)src/mds/Resetter.cc +2
-0@@ -83,6 +83,7 @@ void Resetter::reset() bool done; int r; + this->lock.Lock(); lock.Lock(); journaler->recover(new C_SafeCond(&lock, &cond, &done, &r)); while (!done)@@ -142,5 +143,6 @@ void Resetter::reset() cout << "done" << std::endl; + this->lock.Unlock(); shutdown(); }Signature · 11 lines
1.7.7.6 -- Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free Software Evangelist Red Hat Brazil Compiler Engineer -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html