From patchwork Tue Jul 22 00:29:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ma, Jianpeng" X-Patchwork-Id: 4598741 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5F06F9F375 for ; Tue, 22 Jul 2014 00:29:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6E9BC20114 for ; Tue, 22 Jul 2014 00:29:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 46E9420109 for ; Tue, 22 Jul 2014 00:29:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750888AbaGVA32 (ORCPT ); Mon, 21 Jul 2014 20:29:28 -0400 Received: from mga02.intel.com ([134.134.136.20]:17703 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750831AbaGVA32 convert rfc822-to-8bit (ORCPT ); Mon, 21 Jul 2014 20:29:28 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 21 Jul 2014 17:29:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,705,1400050800"; d="scan'208";a="546908519" Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35]) by orsmga001.jf.intel.com with ESMTP; 21 Jul 2014 17:29:24 -0700 Received: from fmsmsx153.amr.corp.intel.com (10.19.17.7) by FMSMSX104.amr.corp.intel.com (10.19.9.35) with Microsoft SMTP Server (TLS) id 14.3.123.3; Mon, 21 Jul 2014 17:29:24 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX153.amr.corp.intel.com (10.19.17.7) with Microsoft SMTP Server (TLS) id 14.3.123.3; Mon, 21 Jul 2014 17:29:23 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.52]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.26]) with mapi id 14.03.0123.003; Tue, 22 Jul 2014 08:29:21 +0800 From: "Ma, Jianpeng" To: "sage@inktank.com" CC: "ceph-devel@vger.kernel.org" Subject: [PATCH] os/FileJournal: When dump journal, using correctly last-seq avoid misjudging joural corrupt. Thread-Topic: [PATCH] os/FileJournal: When dump journal, using correctly last-seq avoid misjudging joural corrupt. Thread-Index: Ac+ktVwaMx8uVenBQ9qPlKCk1QP+Ow== Date: Tue, 22 Jul 2014 00:29:20 +0000 Message-ID: <6AA21C22F0A5DA478922644AD2EC308C8953EE@SHSMSX101.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In func FileJournal::dump, it always use seq=0 as last-seq and misjudge the journal corrupt. Signed-off-by: Ma Jianpeng --- src/os/FileJournal.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc index 7eb7927..3307655 100644 --- a/src/os/FileJournal.cc +++ b/src/os/FileJournal.cc @@ -564,9 +564,9 @@ int FileJournal::dump(ostream& out) JSONFormatter f(true); f.open_array_section("journal"); + uint64_t seq = 0; while (1) { bufferlist bl; - uint64_t seq = 0; uint64_t pos = read_pos; if (!read_entry(bl, seq)) { dout(3) << "journal_replay: end of journal, done." << dendl;