public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@turbolabs.com>
To: Ben Collins <bcollins@debian.org>
Cc: Andrew Morton <akpm@zip.com.au>, linux-kernel@vger.kernel.org
Subject: Re: Bug in ext3
Date: Thu, 15 Nov 2001 21:50:42 -0700	[thread overview]
Message-ID: <20011115215042.B5739@lynx.no> (raw)
In-Reply-To: <3BF42A1A.5AE96A78@zip.com.au> <20011115160232.H329@visi.net> <20011115145803.R5739@lynx.no> <20011115170628.J329@visi.net> <20011115162149.U5739@lynx.no> <20011115183858.N329@visi.net> <20011115170742.W5739@lynx.no> <20011115195551.Q329@visi.net> <20011115200916.A5739@lynx.no> <20011115222055.S329@visi.net>
In-Reply-To: <20011115222055.S329@visi.net>; from bcollins@debian.org on Thu, Nov 15, 2001 at 10:20:55PM -0500

On Nov 15, 2001  22:20 -0500, Ben Collins wrote:
> On Thu, Nov 15, 2001 at 08:09:16PM -0700, Andreas Dilger wrote:
> > That means the source of the other corruption is unknown.
> 
> The "other" corruption only occured while booted with the ext3-enabled
> kernel. They haven't appeared under the non-ext3 kernel at all. Even
> after it got mounted read-only, performing an fsck, and remounting
> read-write, it would reoccur over and over. So this "other" corruption
> doesn't even sound like it can be caused by the scenario you described
> (which sounds like a one shot problem).

I'm not saying it wasn't caused by ext3, I'm just saying that it is
unknown.

The problem I described _would_ happen each time the filesystem was tried
to be mounted as ext3, but it would only happen to the single file given
as the journal inode (i.e. inode #48 in your case).

You say that remounting the root fs read-only, running fsck, and then
remounting read-write would cause the filesystem to be corrupted?  In that
case, the problem _has_ to be in ext2, because the root filesystem was
mounted as ext2, so there is _no_ way that ext3 could corrupt it again
(the two filesystem codes are completely separate).

Note also, that if you have a serious corruption in the filesystem,
and you run e2fsck on it while it is mounted (read only, presumably),
then you need to reboot the system after e2fsck is done.  Otherwise,
the kernel cache may not be consistent with what is on disk, and anything
that gets written to the disk again from the kernel has the possibility
of corrupting the filesystem.

Normally, this doesn't happen, but it is possible.  With the directories
in the page cache (since 2.4.5 or so), the block device and the directory
pages are not coherent.  This makes it much more important to reboot
if e2fsck makes major changes to the filesystem.  Regular files have
been in the page cache for a long time, but e2fsck does not change the
contents of files, so it is not normally an issue.

This _might_ be worked around by e2fsck calling an ioctl to flush
the kernel caches, but that would probably be complex, and given the
complexity of system startup scripts today it is hard to limit the
number of affected directories/processes.  An alternative would be to put
e2fsck into the initrd, so that root can be checked before it is mounted,
but that is also a change to the way systems are started.

There _may_ also be some issues with the block devices in page cache (i.e.
disconnect between inode tables or bitmaps between the block device user
(e2fsck) and what the kernel sees, but that would be an outright bug.

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/


  parent reply	other threads:[~2001-11-16  4:52 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-15 14:24 Bug in ext3 Ben Collins
2001-11-15 17:22 ` Andrew Morton
2001-11-15 20:34   ` Ben Collins
2001-11-15 20:48     ` Andrew Morton
2001-11-15 21:02       ` Ben Collins
2001-11-15 21:10         ` Andrew Morton
2001-11-15 22:04           ` Ben Collins
2001-11-15 21:58         ` Andreas Dilger
2001-11-15 22:06           ` Ben Collins
2001-11-15 22:49             ` Mike Fedyk
2001-11-15 22:58               ` Ben Collins
2001-11-15 23:21             ` Andreas Dilger
2001-11-15 23:38               ` Ben Collins
2001-11-16  0:07                 ` Andreas Dilger
2001-11-16  0:55                   ` Ben Collins
2001-11-16  3:09                     ` Andreas Dilger
2001-11-16  3:20                       ` Ben Collins
2001-11-16  3:37                         ` Mike Fedyk
2001-11-16  4:50                         ` Andreas Dilger [this message]
2001-11-16 18:38               ` Stephen C. Tweedie
2001-11-16 18:44                 ` Stephen C. Tweedie
2001-11-16 14:52         ` Stephen C. Tweedie

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=20011115215042.B5739@lynx.no \
    --to=adilger@turbolabs.com \
    --cc=akpm@zip.com.au \
    --cc=bcollins@debian.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