linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ext4: misc 3.18-rc2 bugfixes
@ 2014-10-28  1:19 Darrick J. Wong
  2014-10-28  1:19 ` [PATCH 1/3] ext4: enable journal checksum when metadata checksum feature enabled Darrick J. Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Darrick J. Wong @ 2014-10-28  1:19 UTC (permalink / raw)
  To: tytso, darrick.wong; +Cc: linux-ext4

Hi all,

Here are three patches against 3.18-rc2 to fix some problems that I
found in ext4.  The first fix turns on journal checksumming whenever
metadata checksumming is enabled; the second prohibits changing the
journal_checksumming feature during a remount; and the third fixes a
resource leak in extent status procfs files when the journal load
fails.

Comments and questions are, as always, welcome.  I'm done sending
patches for now.  Hopefully.

--D

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/3] ext4: enable journal checksum when metadata checksum feature enabled
  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
  2014-10-29  1:58   ` 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-28  1:19 ` [PATCH 3/3] ext4: remove extent status procfs files if journal load fails Darrick J. Wong
  2 siblings, 1 reply; 7+ messages in thread
From: Darrick J. Wong @ 2014-10-28  1:19 UTC (permalink / raw)
  To: tytso, darrick.wong; +Cc: linux-ext4

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)


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] Subject: [PATCH] ext4: disallow changing journal_csum option during remount
  2014-10-28  1:19 [PATCH 0/3] ext4: misc 3.18-rc2 bugfixes Darrick J. Wong
  2014-10-28  1:19 ` [PATCH 1/3] ext4: enable journal checksum when metadata checksum feature enabled Darrick J. Wong
@ 2014-10-28  1:19 ` 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
  2 siblings, 1 reply; 7+ messages in thread
From: Darrick J. Wong @ 2014-10-28  1:19 UTC (permalink / raw)
  To: tytso, darrick.wong; +Cc: linux-ext4

ext4 does not permit changing the metadata or journal checksum feature
flag while mounted.  Until we decide to support that, don't allow a
remount to change the journal_csum flag (right now we silently fail to
change anything).

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


diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 5c11e21..96059e0 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4845,6 +4845,14 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
 		goto restore_opts;
 	}
 
+	if ((old_opts.s_mount_opt & EXT4_MOUNT_JOURNAL_CHECKSUM) ^
+	    test_opt(sb, JOURNAL_CHECKSUM)) {
+		ext4_msg(sb, KERN_ERR, "changing journal_checksum "
+			 "during remount not supported");
+		err = -EINVAL;
+		goto restore_opts;
+	}
+
 	if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) {
 		if (test_opt2(sb, EXPLICIT_DELALLOC)) {
 			ext4_msg(sb, KERN_ERR, "can't mount with "


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] ext4: remove extent status procfs files if journal load fails
  2014-10-28  1:19 [PATCH 0/3] ext4: misc 3.18-rc2 bugfixes Darrick J. Wong
  2014-10-28  1:19 ` [PATCH 1/3] ext4: enable journal checksum when metadata checksum feature enabled Darrick J. Wong
  2014-10-28  1:19 ` [PATCH 2/3] Subject: [PATCH] ext4: disallow changing journal_csum option during remount Darrick J. Wong
@ 2014-10-28  1:19 ` Darrick J. Wong
  2014-10-29  2:20   ` Theodore Ts'o
  2 siblings, 1 reply; 7+ messages in thread
From: Darrick J. Wong @ 2014-10-28  1:19 UTC (permalink / raw)
  To: tytso, darrick.wong; +Cc: linux-ext4

If we can't load the journal, remove the procfs files for the extent
status information file to avoid leaking resources.

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


diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 96059e0..2c9e686 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3947,7 +3947,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 	if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_MMP) &&
 	    !(sb->s_flags & MS_RDONLY))
 		if (ext4_multi_mount_protect(sb, le64_to_cpu(es->s_mmp_block)))
-			goto failed_mount3;
+			goto failed_mount3a;
 
 	/*
 	 * The first inode we look at is the journal inode.  Don't try
@@ -3956,7 +3956,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 	if (!test_opt(sb, NOLOAD) &&
 	    EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_HAS_JOURNAL)) {
 		if (ext4_load_journal(sb, es, journal_devnum))
-			goto failed_mount3;
+			goto failed_mount3a;
 	} else if (test_opt(sb, NOLOAD) && !(sb->s_flags & MS_RDONLY) &&
 	      EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER)) {
 		ext4_msg(sb, KERN_ERR, "required journal recovery "
@@ -4244,6 +4244,7 @@ failed_mount_wq:
 		jbd2_journal_destroy(sbi->s_journal);
 		sbi->s_journal = NULL;
 	}
+failed_mount3a:
 	ext4_es_unregister_shrinker(sbi);
 failed_mount3:
 	del_timer_sync(&sbi->s_err_report);


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/3] ext4: enable journal checksum when metadata checksum feature enabled
  2014-10-28  1:19 ` [PATCH 1/3] ext4: enable journal checksum when metadata checksum feature enabled Darrick J. Wong
@ 2014-10-29  1:58   ` Theodore Ts'o
  0 siblings, 0 replies; 7+ messages in thread
From: Theodore Ts'o @ 2014-10-29  1:58 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-ext4

On Mon, Oct 27, 2014 at 06:19:22PM -0700, Darrick J. Wong wrote:
> 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>

Applied, thanks.

					- Ted

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] Subject: [PATCH] ext4: disallow changing journal_csum option during remount
  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
  0 siblings, 0 replies; 7+ messages in thread
From: Theodore Ts'o @ 2014-10-29  2:20 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-ext4

On Mon, Oct 27, 2014 at 06:19:29PM -0700, Darrick J. Wong wrote:
> ext4 does not permit changing the metadata or journal checksum feature
> flag while mounted.  Until we decide to support that, don't allow a
> remount to change the journal_csum flag (right now we silently fail to
> change anything).
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Thanks, applied.

					- Ted

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] ext4: remove extent status procfs files if journal load fails
  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
  0 siblings, 0 replies; 7+ messages in thread
From: Theodore Ts'o @ 2014-10-29  2:20 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-ext4

On Mon, Oct 27, 2014 at 06:19:35PM -0700, Darrick J. Wong wrote:
> If we can't load the journal, remove the procfs files for the extent
> status information file to avoid leaking resources.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Thanks, applied.

					- Ted

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-10-29  2:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-28  1:19 [PATCH 0/3] ext4: misc 3.18-rc2 bugfixes Darrick J. Wong
2014-10-28  1:19 ` [PATCH 1/3] ext4: enable journal checksum when metadata checksum feature enabled Darrick J. Wong
2014-10-29  1:58   ` 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

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).