linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ronghua Zhang <rz5b@cs.virginia.edu>
To: linux-fsdevel@vger.kernel.org, kernelnewbies@nl.linux.org,
	linux-kernel@vger.kernel.org
Subject: ext2 cannot be compiled as module
Date: Wed, 19 Feb 2003 11:29:20 -0500 (EST)	[thread overview]
Message-ID: <Pine.GSO.4.51.0302191110040.18317@mamba.cs.Virginia.EDU> (raw)

Hi,
  I compiled ext2 support into a module, but when I mount an ext
partition, kernel oops. The following is what I have done:
 1. copy ext2 directory into another one, say test
 2. change the file system name into 'test'
 3. compile it into a module ext2.o
 4. insmod ext2.o
 5. mound /dev/hdb1 /mnt -t test, kernel oops.

I found out the oops happens at ext2_read_inode() called by
ext2_read_super() to read inode for the root. ext2_read_inode() need to
access inode->i_sb->u.ext2_sb.s_es, but suprisingly, this s_es is NULL!
I further found that this is because inode->i_sb does NOT points to the
supper block whose content is filled by ext2_read_super(), instead it
points to other unknown memory. Printing out inode->s_sb in
ext2_read_inode() and priniting out sb before ext2_read_super() executes
sb->s_root = d_alloc_root(iget(sb, EXT2_ROOT_INO)) can easily reveal this
problem.

I also wrote a very simple file system, only implementing read_super and
read_inode. When it's compiled as a module, the same problem exists. But
when it's compiled into the kernel, no problem at all!

Is it a bug or am I missing something? BTW, the kernel is 2.4.19 and gcc
is 3.2

Ronghua

                 reply	other threads:[~2003-02-19 16:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=Pine.GSO.4.51.0302191110040.18317@mamba.cs.Virginia.EDU \
    --to=rz5b@cs.virginia.edu \
    --cc=kernelnewbies@nl.linux.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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).