From patchwork Mon May 13 21:49:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darrick Wong X-Patchwork-Id: 243542 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.180.67]) by ozlabs.org (Postfix) with ESMTP id EBA1D2C009F for ; Tue, 14 May 2013 07:49:48 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755121Ab3EMVtr (ORCPT ); Mon, 13 May 2013 17:49:47 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:42280 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752220Ab3EMVtq (ORCPT ); Mon, 13 May 2013 17:49:46 -0400 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r4DLnggW020799 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 13 May 2013 21:49:42 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r4DLngON000247 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 13 May 2013 21:49:42 GMT Received: from abhmt115.oracle.com (abhmt115.oracle.com [141.146.116.67]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r4DLnfUU005019; Mon, 13 May 2013 21:49:41 GMT Received: from localhost (/10.137.227.126) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 13 May 2013 14:49:41 -0700 Date: Mon, 13 May 2013 14:49:40 -0700 From: "Darrick J. Wong" To: "Theodore Ts'o" Cc: Andreas Dilger , linux-ext4 , linux-fsdevel Subject: [PATCH v2] jbd2: Always set journal superblock checksum when writing out superblock Message-ID: <20130513214940.GC8037@blackbox.djwong.org> References: <20130510234013.GC5706@blackbox.djwong.org> <328F41F9-3133-4742-9172-C7C3C79BD1CB@dilger.ca> <20130513184615.GA8037@blackbox.djwong.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130513184615.GA8037@blackbox.djwong.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: ucsinet21.oracle.com [156.151.31.93] Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Avoid future programming errors by making it so that the journal superblock checksum is set in jbd2_write_superblock. This fixes some journal checksum failures when metadata_csum is turned on. Signed-off-by: Darrick J. Wong --- fs/jbd2/journal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 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 diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 4576bec..85550bf 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -1325,6 +1325,7 @@ static void jbd2_write_superblock(journal_t *journal, int write_op) if (!(journal->j_flags & JBD2_BARRIER)) write_op &= ~(REQ_FUA | REQ_FLUSH); lock_buffer(bh); + jbd2_superblock_csum_set(journal, journal->j_superblock); if (buffer_write_io_error(bh)) { /* * Oh, dear. A previous attempt to write the journal @@ -1436,7 +1437,6 @@ void jbd2_journal_update_sb_errno(journal_t *journal) jbd_debug(1, "JBD2: updating superblock error (errno %d)\n", journal->j_errno); sb->s_errno = cpu_to_be32(journal->j_errno); - jbd2_superblock_csum_set(journal, sb); read_unlock(&journal->j_state_lock); jbd2_write_superblock(journal, WRITE_SYNC);