public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Bastien-Filiatrault <lintuxicated@yahoo.ca>
To: linux-kernel@vger.kernel.org
Cc: viro@math.psu.edu
Subject: Weirdness with romfs automatic filesystem detection
Date: Thu, 11 Mar 2004 11:37:34 -0500	[thread overview]
Message-ID: <1079023053.887.3.camel@6-allhosts> (raw)

(SRY for the double post, the yahoo web interface is borked)
Hi to you all,
	Recently(yesterday), I had trouble getting the kernel(2.6.3) to mount
my romfs initrd. After hours of tinkering, I found out that I HAD to
specify rootfstype in order to make it work(ext2 worked w/o rootfstype).
	So, I did a little investigating(see patch below), I found out that
when the romfs driver is the first to try to mount the initrd, it does
allright, but when it tries after all the other drivers, it fails with
code -22(EINVAL I think)

Conclusions:
-This is expected behaviour (hope not).
-The filesystem drivers modify the initrd or its state.
-The romfs driver has something nasty in it.
-Im only a n00b and I dont know what im talking about.

It would be great if I could get help solving this mistery, as my
hacking skills are lacking...

Sincerly, Joe

Below is my kernel output:

By leaving the kernel determine the filesystem type (copied by hand):

(next line when using compressed ramdisk)
RAMDISK: Compressed image found at block 0
(next two lines w/o compression)
RAMDISK: romfs filesystem found at block 0
RAMDISK: Loading 1093 blocks [1 disk] into ram disk... done.
Trying to mount root as type reiserfs: got -22
Trying to mount root as type minix: got -22
Trying to mount root as type vfat: got -22
Trying to mount root as type iso9660: got -22
Trying to mount root as type ntfs: got -22
Trying to mount root as type romfs: VFS: Can't find a romfs filesystem
on dev ram0.
got -22
...
Panic, could not mount root fs, etc


By specifiyng rootfstype=romfs:

(next line when using compressed ramdisk)
RAMDISK: Compressed image found at block 0
(next two lines w/o compression)
RAMDISK: romfs filesystem found at block 0
RAMDISK: Loading 1093 blocks [1 disk] into ram disk... done.
Trying to mount root as type romfs: VFS: Mounted root (romfs filesystem)
readonly.
got 0
...
success, initrd mounts system, etc...

This patch show the code returned by the different fs drivers.

diff -uprN linux-2.6.3/fs/romfs/inode.c linux-modded/fs/romfs/inode.c
--- linux-2.6.3/fs/romfs/inode.c	2004-02-17 22:58:40.000000000 -0500
+++ linux-modded/fs/romfs/inode.c	2004-03-10 21:54:41.000000000 -0500
@@ -116,6 +116,7 @@ static int romfs_fill_super(struct super
 	struct buffer_head *bh;
 	struct romfs_super_block *rsb;
 	int sz;
+	silent = 0;
 
 	/* I would parse the options here, but there are none.. :) */
 
diff -uprN linux-2.6.3/init/do_mounts.c linux-modded/init/do_mounts.c
--- linux-2.6.3/init/do_mounts.c	2004-02-17 22:57:28.000000000 -0500
+++ linux-modded/init/do_mounts.c	2004-03-10 21:44:32.000000000 -0500
@@ -274,7 +274,10 @@ void __init mount_block_root(char *name,
 	get_fs_names(fs_names);
 retry:
 	for (p = fs_names; *p; p += strlen(p)+1) {
-		int err = do_mount_root(name, p, flags, root_mount_data);
+		int err;
+		printk("Trying to mount root as type %s: ", p);
+		err = do_mount_root(name, p, flags, root_mount_data);
+		printk("got %d\n", err);
 		switch (err) {
 			case 0:
 				goto out;



             reply	other threads:[~2004-03-11 16:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-11 16:37 Jonathan Bastien-Filiatrault [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-03-11 16:25 Weirdness with romfs automatic filesystem detection Jonathan Filiatrault

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=1079023053.887.3.camel@6-allhosts \
    --to=lintuxicated@yahoo.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@math.psu.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