linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Milton Miller <miltonm@bga.com>
To: Mark Lord <kernel@teksavvy.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-ext4@vger.kernel.org>,
	Joel Becker <jlbec@evilplan.org>, "Ted Ts'o" <tytso@mit.edu>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	"John Stoffel" <john@stoffel.org>,
	Ric Wheeler <ricwheeler@gmail.com>
Subject: [PATCH] ext4: register ext2 and ext3 alias after ext4
Date: Thu, 14 Apr 2011 10:41:23 -0500	[thread overview]
Message-ID: <ext4-masq@mdm.bga.com> (raw)
In-Reply-To: <20110413223005.GB6821@noexit>

The intent of CONFIG_EXT4_USE_FOR_EXT23 is to provide an alias so
that the ext4 module is sufficient even if user space calls out ext2.
However, it currently registers the alias names before registering ext4.
This means they show up first in /proc/filesystems and ext3 and ext4
formatted file systems show up in the mount list as ext4.

Register the filesystem aliases after ext4 so they show as ext4 until the
filesystems is filtered.  This will avoid users or tools configuring a
kernel with just ext2 and wondering why there system broke.  Also register
in the same order as listed in fs/Makefile.

Signed-off-by: Milton Miller <miltonm@bga.com>
---

Untested but simple code movement.  Mark will you please test?

Is it safe to initialize ext4_li_info and ext4_li_mtx after we register
the filesystem?  What keeps the init after the first call to mount
a filesystem?

I checked unregister_filesystem and it is safe when the file system
type is and is not registered.

Index: work.git/fs/ext4/super.c
===================================================================
--- work.git.orig/fs/ext4/super.c	2011-04-14 09:26:43.250066794 -0500
+++ work.git/fs/ext4/super.c	2011-04-14 09:29:53.220061521 -0500
@@ -4898,11 +4898,11 @@ static int __init ext4_init_fs(void)
 	err = init_inodecache();
 	if (err)
 		goto out1;
-	register_as_ext2();
-	register_as_ext3();
 	err = register_filesystem(&ext4_fs_type);
 	if (err)
 		goto out;
+	register_as_ext3();
+	register_as_ext2();
 
 	ext4_li_info = NULL;
 	mutex_init(&ext4_li_mtx);

  reply	other threads:[~2011-04-14 15:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-12 17:25 CONFIG_EXT4_USE_FOR_EXT23: rootfs shows as ext2 instead of ext4 Mark Lord
2011-04-13  0:49 ` Ted Ts'o
2011-04-13 14:05   ` Mark Lord
2011-04-13 14:10   ` Mark Lord
2011-04-13 21:00     ` Theodore Tso
2011-04-13 22:30       ` Joel Becker
2011-04-14 15:41         ` Milton Miller [this message]
2011-04-15  1:07           ` [PATCH] ext4: register ext2 and ext3 alias after ext4 Mark Lord
2011-04-17  2:01           ` Ted Ts'o
2011-04-14  1:34       ` CONFIG_EXT4_USE_FOR_EXT23: rootfs shows as ext2 instead of ext4 Mark Lord
2011-04-14 12:47         ` Theodore Tso
2011-04-13 16:45   ` John Stoffel
2011-04-13 18:17     ` Ric Wheeler

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=ext4-masq@mdm.bga.com \
    --to=miltonm@bga.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=jlbec@evilplan.org \
    --cc=john@stoffel.org \
    --cc=kernel@teksavvy.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ricwheeler@gmail.com \
    --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).