From patchwork Thu Apr 7 13:49:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 692511 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p37DxGuC026338 for ; Thu, 7 Apr 2011 13:59:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751527Ab1DGN7O (ORCPT ); Thu, 7 Apr 2011 09:59:14 -0400 Received: from lsd-gw.ic.unicamp.br ([143.106.7.165]:54748 "EHLO boneca.lsd.ic.unicamp.br" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751087Ab1DGN7N (ORCPT ); Thu, 7 Apr 2011 09:59:13 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 07 Apr 2011 13:59:17 +0000 (UTC) X-Greylist: delayed 551 seconds by postgrey-1.27 at vger.kernel.org; Thu, 07 Apr 2011 09:59:13 EDT Received: from freie.oliva.athome.lsd.ic.unicamp.br (gw-to-emilia.oliva.athome.lsd.ic.unicamp.br [172.31.160.17] (may be forged)) by boneca.lsd.ic.unicamp.br (8.14.4/8.14.4) with ESMTP id p37DnqBF025533 for ; Thu, 7 Apr 2011 10:49:54 -0300 Received: from livre.localdomain (livre-to-gw.oliva.athome.lsd.ic.unicamp.br [172.31.160.19]) by freie.oliva.athome.lsd.ic.unicamp.br (8.14.4/8.14.4) with ESMTP id p37DnpWo005873 for ; Thu, 7 Apr 2011 10:49:51 -0300 Received: from livre.localdomain (aoliva@localhost.localdomain [127.0.0.1]) by livre.localdomain (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p37Dnoa6021471; Thu, 7 Apr 2011 10:49:50 -0300 Received: (from aoliva@localhost) by livre.localdomain (8.14.3/8.14.3/Submit) id p37DnnOF021469; Thu, 7 Apr 2011 10:49:49 -0300 X-Authentication-Warning: livre.localdomain: aoliva set sender to oliva@lsd.ic.unicamp.br using -f From: Alexandre Oliva To: ceph-devel@vger.kernel.org Subject: [PATCH] Don't crash during initialization when working without an osd journal. Organization: Free thinker, not speaking for University of Campinas Date: Thu, 07 Apr 2011 10:49:49 -0300 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Signed-off-by: Alexandre Oliva --- src/os/FileStore.cc | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 940662c..0fb99e6 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -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;