Don't crash during initialization when working without an osd journal.
PATCH 1/1 Don't crash during initialization when working without an osd journal.
Signed-off-by Alexandre Oliva <[email protected]>
--- src/os/FileStore.cc | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
src/os/FileStore.cc +4 -2
@@ -1471,7 +1471,8 @@ void FileStore::start_logger(int whoami, utime_t tare) char name[80]; snprintf(name, sizeof(name), "osd.%d.fs.log", whoami); logger = new ProfLogger(name, (ProfLogType*)&fs_logtype); - journal->logger = logger; + if (journal) + journal->logger = logger; logger_add(logger); logger_tare(tare); logger_start();
@@ -1481,7 +1482,8 @@ void FileStore::stop_logger() { dout(10) << "stop_logger" << dendl; if (logger) { - journal->logger = NULL; + if (journal) + journal->logger = NULL; logger_remove(logger); delete logger; logger = NULL;
Signature · 8 lines
1.7.4.2 -- 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
Sage Weil
AppliedApplied, thanks!
sage
Quoted 44 lines · Alexandre Oliva
Signed-off-by Alexandre Oliva <[email protected]>--- src/os/FileStore.cc | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)src/os/FileStore.cc +4
-2@@ -1471,7 +1471,8 @@ void FileStore::start_logger(int whoami, utime_t tare) char name[80]; snprintf(name, sizeof(name), "osd.%d.fs.log", whoami); logger = new ProfLogger(name, (ProfLogType*)&fs_logtype); - journal->logger = logger; + if (journal) + journal->logger = logger; logger_add(logger); logger_tare(tare); logger_start();@@ -1481,7 +1482,8 @@ void FileStore::stop_logger() { dout(10) << "stop_logger" << dendl; if (logger) { - journal->logger = NULL; + if (journal) + journal->logger = NULL; logger_remove(logger); delete logger; logger = NULL;Signature · 12 lines
1.7.4.2 -- 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