linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: tytso@mit.edu, darrick.wong@oracle.com
Cc: linux-ext4@vger.kernel.org
Subject: [PATCH 1/3] ext4: enable journal checksum when metadata checksum feature enabled
Date: Mon, 27 Oct 2014 18:19:22 -0700	[thread overview]
Message-ID: <20141028011922.30103.65942.stgit@birch.djwong.org> (raw)
In-Reply-To: <20141028011916.30103.50751.stgit@birch.djwong.org>

If metadata checksumming is turned on for the FS, we need to tell the
journal to use checksumming too.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/ext4/super.c |    4 ++++
 1 file changed, 4 insertions(+)


diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 1eda6ab..5c11e21 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3526,6 +3526,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 #ifdef CONFIG_EXT4_FS_POSIX_ACL
 	set_opt(sb, POSIX_ACL);
 #endif
+	/* don't forget to enable journal_csum when metadata_csum is enabled. */
+	if (ext4_has_metadata_csum(sb))
+		set_opt(sb, JOURNAL_CHECKSUM);
+
 	if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_DATA)
 		set_opt(sb, JOURNAL_DATA);
 	else if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_ORDERED)


  reply	other threads:[~2014-10-28  1:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-28  1:19 [PATCH 0/3] ext4: misc 3.18-rc2 bugfixes Darrick J. Wong
2014-10-28  1:19 ` Darrick J. Wong [this message]
2014-10-29  1:58   ` [PATCH 1/3] ext4: enable journal checksum when metadata checksum feature enabled Theodore Ts'o
2014-10-28  1:19 ` [PATCH 2/3] Subject: [PATCH] ext4: disallow changing journal_csum option during remount Darrick J. Wong
2014-10-29  2:20   ` Theodore Ts'o
2014-10-28  1:19 ` [PATCH 3/3] ext4: remove extent status procfs files if journal load fails Darrick J. Wong
2014-10-29  2:20   ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141028011922.30103.65942.stgit@birch.djwong.org \
    --to=darrick.wong@oracle.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).