2022-08-10 20:29:36

by Marc Aurèle La France

[permalink] [raw]
Subject: [PATCH] ext4: Register ext[23] support only after successful ext4 registration

Register ext4 as a "replacement" for ext2 and ext3 only after ext4 itself has
been successfully registered. As a side effect, this allows
unregister_as_ext[23]() to be inlined.

This change is not eligible for stable@.

Please Reply-To-All.

Thanks and have a great day.

Marc.

Signed-off-by: Marc Aurèle La France <[email protected]>

diff -aNpRruz -X /etc/diff.excludes linux-5.17.1/fs/ext4/super.c devel-5.17.1/fs/ext4/super.c
--- linux-5.17.1/fs/ext4/super.c 2022-03-28 02:03:22.000000000 -0600
+++ devel-5.17.1/fs/ext4/super.c 2022-03-28 07:14:10.799008309 -0600
@@ -7123,16 +7123,14 @@ static int __init ext4_init_fs(void)
if (err)
goto out05;

- register_as_ext3();
- register_as_ext2();
err = register_filesystem(&ext4_fs_type);
if (err)
goto out;

+ register_as_ext3();
+ register_as_ext2();
return 0;
out:
- unregister_as_ext2();
- unregister_as_ext3();
ext4_fc_destroy_dentry_cache();
out05:
destroy_inodecache();


2022-09-29 14:30:28

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH] ext4: Register ext[23] support only after successful ext4 registration

On Wed, Aug 10, 2022 at 02:20:45PM -0600, Marc Aur?le La France wrote:
> Register ext4 as a "replacement" for ext2 and ext3 only after ext4 itself has
> been successfully registered. As a side effect, this allows
> unregister_as_ext[23]() to be inlined.

The corrent ordering is deliberate; it allows file systems that have
ext2 and ext3 only file system features will be reported as using ext2
and ext3 in /proc/mounts. This doesn't matter quite as much, but it
could potentially break userspace if a legacy file system that only
has ext2 file system features is mounted and reported as ext4.

So sorry, I can't take this change.

- Ted