From patchwork Fri Oct 10 08:57:38 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hidehiro Kawai X-Patchwork-Id: 3700 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 35639DDFB5 for ; Fri, 10 Oct 2008 19:57:51 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752655AbYJJI5u (ORCPT ); Fri, 10 Oct 2008 04:57:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752640AbYJJI5u (ORCPT ); Fri, 10 Oct 2008 04:57:50 -0400 Received: from mail4.hitachi.co.jp ([133.145.228.5]:36150 "EHLO mail4.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752483AbYJJI5s (ORCPT ); Fri, 10 Oct 2008 04:57:48 -0400 Received: from mlsv1.hitachi.co.jp (unknown [133.144.234.166]) by mail4.hitachi.co.jp (Postfix) with ESMTP id 47E4F33CCA; Fri, 10 Oct 2008 17:57:47 +0900 (JST) Received: from MFILTER-S2.hitachi.co.jp by mlsv1.hitachi.co.jp (8.13.1/8.13.1) id m9A8vlVM003293; Fri, 10 Oct 2008 17:57:47 +0900 Received: from vshuts3.hitachi.co.jp (unverified) by MFILTER-S2.hitachi.co.jp (Content Technologies SMTPRS 4.3.17) with ESMTP id ; Fri, 10 Oct 2008 17:57:46 +0900 X-AuditID: 0ac90648-aad1eba000004214-9f-48ef190a786f Received: from hsdlgw92.sdl.hitachi.co.jp (unknown [133.144.7.20]) by vshuts3.hitachi.co.jp (Symantec Mail Security) with ESMTP id C80F177428B; Fri, 10 Oct 2008 17:57:46 +0900 (JST) Received: from vgate2.sdl.hitachi.co.jp by hsdlgw92.sdl.hitachi.co.jp (8.13.1/3.7W06092911) id m9A8vkra031734; Fri, 10 Oct 2008 17:57:46 +0900 Received: from sdl99w.sdl.hitachi.co.jp ([133.144.14.250]) by vgate2.sdl.hitachi.co.jp (SAVSMTP 3.1.1.32) with SMTP id M2008101017574507966; Fri, 10 Oct 2008 17:57:45 +0900 Received: from hitachi.com (IDENT:U2FsdGVkX1/OSqEWElhdmCms+/vNgcPV71/xCeDh35U@localhost.localdomain [127.0.0.1]) by sdl99w.sdl.hitachi.co.jp (8.13.1/3.7W04031011) with ESMTP id m9A8vcJM008355; Fri, 10 Oct 2008 17:57:38 +0900 Message-ID: <48EF1902.5050905@hitachi.com> Date: Fri, 10 Oct 2008 17:57:38 +0900 From: Hidehiro Kawai User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ja-JP; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: ja MIME-Version: 1.0 To: tytso@mit.edu, adilger@sun.com Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, jack@suse.cz Subject: [PATCH 1/4] jbd2: abort when failed to log metadata buffers References: <48EF168A.4000705@hitachi.com> In-Reply-To: <48EF168A.4000705@hitachi.com> X-Brightmail-Tracker: AAAAAA== Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org If we failed to write metadata buffers to the journal space and succeeded to write the commit record, stale data can be written back to the filesystem as metadata in the recovery phase. To avoid this, when we failed to write out metadata buffers, abort the journal before writing the commit record. We can also avoid this kind of corruption by using check-summing feature because it can detect invalid metadata blocks in the journal and avoid them from being replayed. So we don't need to care about asynchronous commit record writeout with a check sum. Signed-off-by: Hidehiro Kawai --- fs/jbd2/commit.c | 3 +++ 1 file changed, 3 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-2.6.27-rc9-ex4-1/fs/jbd2/commit.c =================================================================== --- linux-2.6.27-rc9-ex4-1.orig/fs/jbd2/commit.c +++ linux-2.6.27-rc9-ex4-1/fs/jbd2/commit.c @@ -783,6 +783,9 @@ wait_for_iobuf: /* AKPM: bforget here */ } + if (err) + jbd2_journal_abort(journal, err); + jbd_debug(3, "JBD: commit phase 5\n"); if (!JBD2_HAS_INCOMPAT_FEATURE(journal,