All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ext4: reject the 'commit' option on ext2 filesystems
@ 2022-05-10 18:32 Eric Biggers
  2022-05-11  8:26 ` Lukas Czerner
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Eric Biggers @ 2022-05-10 18:32 UTC (permalink / raw)
  To: linux-ext4; +Cc: fstests, Lukas Czerner

From: Eric Biggers <ebiggers@google.com>

The 'commit' option is only applicable for ext3 and ext4 filesystems,
and has never been accepted by the ext2 filesystem driver, so the ext4
driver shouldn't allow it on ext2 filesystems.

This fixes a failure in xfstest ext4/053.

Fixes: 8dc0aa8cf0f7 ("ext4: check incompatible mount options while mounting ext2/3")
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 fs/ext4/super.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 1847b46af8083..69d67724df24f 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1913,6 +1913,7 @@ static const struct mount_opts {
 	 MOPT_EXT4_ONLY | MOPT_CLEAR},
 	{Opt_warn_on_error, EXT4_MOUNT_WARN_ON_ERROR, MOPT_SET},
 	{Opt_nowarn_on_error, EXT4_MOUNT_WARN_ON_ERROR, MOPT_CLEAR},
+	{Opt_commit, 0, MOPT_NO_EXT2},
 	{Opt_nojournal_checksum, EXT4_MOUNT_JOURNAL_CHECKSUM,
 	 MOPT_EXT4_ONLY | MOPT_CLEAR},
 	{Opt_journal_checksum, EXT4_MOUNT_JOURNAL_CHECKSUM,

base-commit: 23e3d7f7061f8682c751c46512718f47580ad8f0
-- 
2.36.1


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

* Re: [PATCH] ext4: reject the 'commit' option on ext2 filesystems
  2022-05-10 18:32 [PATCH] ext4: reject the 'commit' option on ext2 filesystems Eric Biggers
@ 2022-05-11  8:26 ` Lukas Czerner
  2022-05-11 12:31 ` Ritesh Harjani
  2022-05-19  2:05 ` Theodore Ts'o
  2 siblings, 0 replies; 4+ messages in thread
From: Lukas Czerner @ 2022-05-11  8:26 UTC (permalink / raw)
  To: Eric Biggers; +Cc: linux-ext4, fstests

On Tue, May 10, 2022 at 11:32:32AM -0700, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
> 
> The 'commit' option is only applicable for ext3 and ext4 filesystems,
> and has never been accepted by the ext2 filesystem driver, so the ext4
> driver shouldn't allow it on ext2 filesystems.
> 
> This fixes a failure in xfstest ext4/053.
> 
> Fixes: 8dc0aa8cf0f7 ("ext4: check incompatible mount options while mounting ext2/3")
> Signed-off-by: Eric Biggers <ebiggers@google.com>

Good catch, thanks.

Reviewed-by: Lukas Czerner <lczerner@redhat.com>

> ---
>  fs/ext4/super.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 1847b46af8083..69d67724df24f 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -1913,6 +1913,7 @@ static const struct mount_opts {
>  	 MOPT_EXT4_ONLY | MOPT_CLEAR},
>  	{Opt_warn_on_error, EXT4_MOUNT_WARN_ON_ERROR, MOPT_SET},
>  	{Opt_nowarn_on_error, EXT4_MOUNT_WARN_ON_ERROR, MOPT_CLEAR},
> +	{Opt_commit, 0, MOPT_NO_EXT2},
>  	{Opt_nojournal_checksum, EXT4_MOUNT_JOURNAL_CHECKSUM,
>  	 MOPT_EXT4_ONLY | MOPT_CLEAR},
>  	{Opt_journal_checksum, EXT4_MOUNT_JOURNAL_CHECKSUM,
> 
> base-commit: 23e3d7f7061f8682c751c46512718f47580ad8f0
> -- 
> 2.36.1
> 


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

* Re: [PATCH] ext4: reject the 'commit' option on ext2 filesystems
  2022-05-10 18:32 [PATCH] ext4: reject the 'commit' option on ext2 filesystems Eric Biggers
  2022-05-11  8:26 ` Lukas Czerner
@ 2022-05-11 12:31 ` Ritesh Harjani
  2022-05-19  2:05 ` Theodore Ts'o
  2 siblings, 0 replies; 4+ messages in thread
From: Ritesh Harjani @ 2022-05-11 12:31 UTC (permalink / raw)
  To: Eric Biggers; +Cc: linux-ext4, fstests, Lukas Czerner

On 22/05/10 11:32AM, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
>
> The 'commit' option is only applicable for ext3 and ext4 filesystems,
> and has never been accepted by the ext2 filesystem driver, so the ext4
> driver shouldn't allow it on ext2 filesystems.

Yes indeed.

Although with -o commit=1 it doesn't mount due to extra checks when commit is not
equal to it's default value where it also checks if the fs has journal or not.

[19084.421413] EXT4-fs (loop2): mounting ext2 file system using the ext4 subsystem
[19084.422679] EXT4-fs (loop2): can't mount with commit=1, fs mounted w/o journal


But when mounted with -o commit=5, ext2 gets mounted w/o this patch ;)

[19146.337981] EXT4-fs (loop2): mounting ext2 file system using the ext4 subsystem
[19146.345082] EXT4-fs (loop2): mounted filesystem without journal. Quota mode: none.

Feel free to add -

Reviewed-by: Ritesh Harjani <ritesh.list@gmail.com>

-ritesh

>
> This fixes a failure in xfstest ext4/053.
>
> Fixes: 8dc0aa8cf0f7 ("ext4: check incompatible mount options while mounting ext2/3")
> Signed-off-by: Eric Biggers <ebiggers@google.com>
> ---
>  fs/ext4/super.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 1847b46af8083..69d67724df24f 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -1913,6 +1913,7 @@ static const struct mount_opts {
>  	 MOPT_EXT4_ONLY | MOPT_CLEAR},
>  	{Opt_warn_on_error, EXT4_MOUNT_WARN_ON_ERROR, MOPT_SET},
>  	{Opt_nowarn_on_error, EXT4_MOUNT_WARN_ON_ERROR, MOPT_CLEAR},
> +	{Opt_commit, 0, MOPT_NO_EXT2},
>  	{Opt_nojournal_checksum, EXT4_MOUNT_JOURNAL_CHECKSUM,
>  	 MOPT_EXT4_ONLY | MOPT_CLEAR},
>  	{Opt_journal_checksum, EXT4_MOUNT_JOURNAL_CHECKSUM,
>
> base-commit: 23e3d7f7061f8682c751c46512718f47580ad8f0
> --
> 2.36.1
>

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

* Re: [PATCH] ext4: reject the 'commit' option on ext2 filesystems
  2022-05-10 18:32 [PATCH] ext4: reject the 'commit' option on ext2 filesystems Eric Biggers
  2022-05-11  8:26 ` Lukas Czerner
  2022-05-11 12:31 ` Ritesh Harjani
@ 2022-05-19  2:05 ` Theodore Ts'o
  2 siblings, 0 replies; 4+ messages in thread
From: Theodore Ts'o @ 2022-05-19  2:05 UTC (permalink / raw)
  To: linux-ext4, Eric Biggers; +Cc: Theodore Ts'o, fstests, Lukas Czerner

On Tue, 10 May 2022 11:32:32 -0700, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
> 
> The 'commit' option is only applicable for ext3 and ext4 filesystems,
> and has never been accepted by the ext2 filesystem driver, so the ext4
> driver shouldn't allow it on ext2 filesystems.
> 
> This fixes a failure in xfstest ext4/053.
> 
> [...]

Applied, thanks!

[1/1] ext4: reject the 'commit' option on ext2 filesystems
      commit: cb8435dc8ba33bcafa41cf2aa253794320a3b8df

Best regards,
-- 
Theodore Ts'o <tytso@mit.edu>

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

end of thread, other threads:[~2022-05-19  2:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-10 18:32 [PATCH] ext4: reject the 'commit' option on ext2 filesystems Eric Biggers
2022-05-11  8:26 ` Lukas Czerner
2022-05-11 12:31 ` Ritesh Harjani
2022-05-19  2:05 ` Theodore Ts'o

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.