Skip to contentSkip to conversation

Don't crash during initialization when working without an osd journal.

PATCH Applied Alexandre Oliva 2 participants 2 messages Apr 7, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Don't crash during initialization when working without an osd journal.

---
 src/os/FileStore.cc |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
src/os/FileStore.cc +4 -2
index 940662c..0fb99e6 100644
@@ -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
Applied
#1 lore raw

Applied, thanks!

sage

Quoted 44 lines · Alexandre Oliva
---
 src/os/FileStore.cc |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
src/os/FileStore.cc +4 -2
index 940662c..0fb99e6 100644
@@ -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