* Re: Problem mounting ext2 using ext3?
2008-05-05 22:26 ` Theodore Tso
@ 2008-05-06 7:11 ` Geert Uytterhoeven
2008-05-06 7:26 ` Vegard Nossum
2008-05-06 10:02 ` Jan Kara
2 siblings, 0 replies; 9+ messages in thread
From: Geert Uytterhoeven @ 2008-05-06 7:11 UTC (permalink / raw)
To: Theodore Tso; +Cc: linux-ext4, Linux Kernel Development, Linux/m68k, Jan Kara
Hi Ted,
On Mon, 5 May 2008, Theodore Tso wrote:
> On Mon, May 05, 2008 at 11:11:46PM +0200, Geert Uytterhoeven wrote:
> > when mounting the root file system, which is ext2 (has_journal is not set).
> > Apparently it crashes in ext3_sync_fs because EXT3_SB(sb)->s_journal is NULL.
> >
> > At first I thought it was an issue with the byteswapped IDE bus on Atari (a
> > new and different solution to handle this just went into mainline), but if I
> > disable CONFIG_EXT3 support, it boots up fine.
> >
> > Is this a known problem?
>
> I can confirm this as a regression. You don't even need to mount it
Thanks for confirming!
> as a root filesystem, or do this on an 68k system. On my x86 system,
That's all I had available for a quick test ;-)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Problem mounting ext2 using ext3?
2008-05-05 22:26 ` Theodore Tso
2008-05-06 7:11 ` Geert Uytterhoeven
@ 2008-05-06 7:26 ` Vegard Nossum
2008-05-06 9:50 ` Jan Kara
2008-05-06 12:05 ` Theodore Tso
2008-05-06 10:02 ` Jan Kara
2 siblings, 2 replies; 9+ messages in thread
From: Vegard Nossum @ 2008-05-06 7:26 UTC (permalink / raw)
To: Theodore Tso, Geert Uytterhoeven, linux-ext4,
Linux Kernel Development, Linux/m68k, Jan Kara
Hi,
On Tue, May 6, 2008 at 12:26 AM, Theodore Tso <tytso@mit.edu> wrote:
> On Mon, May 05, 2008 at 11:11:46PM +0200, Geert Uytterhoeven wrote:
> > when mounting the root file system, which is ext2 (has_journal is not set).
> > Apparently it crashes in ext3_sync_fs because EXT3_SB(sb)->s_journal is NULL.
> >
> > At first I thought it was an issue with the byteswapped IDE bus on Atari (a
> > new and different solution to handle this just went into mainline), but if I
> > disable CONFIG_EXT3 support, it boots up fine.
> >
> > Is this a known problem?
>
> I can confirm this as a regression. You don't even need to mount it
> as a root filesystem, or do this on an 68k system. On my x86 system,
> using a kernel based off of git commit: afa26be8 (6 commits after
> 2.6.26-rc1), mounting an ext3 filesystem, you can cause an oops by
> taking an ext2 filesystem and forcing a mount as ext3, "mount -t ext3
> /dev/closure/textext2fs /mnt"). (see below for my oops). This does
> not occur with a kernel based off of 2.6.25, so it's a definite
> regression.
Hi,
I posted a very similar problem a couple of days ago:
http://www.nabble.com/BUG-in-ext3_sync_fs-td16999997.html
to which I got zero replies. Can I close this in my internal bugzilla
as dup/"not my fault"? The stacktrace looks very similar. This was
also ext2 fs mounted (apparently) by ext3 code.
Thanks.
Vegard
--
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
-- E. W. Dijkstra, EWD1036
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Problem mounting ext2 using ext3?
2008-05-06 7:26 ` Vegard Nossum
@ 2008-05-06 9:50 ` Jan Kara
2008-05-06 12:05 ` Theodore Tso
1 sibling, 0 replies; 9+ messages in thread
From: Jan Kara @ 2008-05-06 9:50 UTC (permalink / raw)
To: Vegard Nossum
Cc: Theodore Tso, Geert Uytterhoeven, linux-ext4,
Linux Kernel Development, Linux/m68k
On Tue 06-05-08 09:26:30, Vegard Nossum wrote:
> Hi,
>
> On Tue, May 6, 2008 at 12:26 AM, Theodore Tso <tytso@mit.edu> wrote:
> > On Mon, May 05, 2008 at 11:11:46PM +0200, Geert Uytterhoeven wrote:
> > > when mounting the root file system, which is ext2 (has_journal is not set).
> > > Apparently it crashes in ext3_sync_fs because EXT3_SB(sb)->s_journal is NULL.
> > >
> > > At first I thought it was an issue with the byteswapped IDE bus on Atari (a
> > > new and different solution to handle this just went into mainline), but if I
> > > disable CONFIG_EXT3 support, it boots up fine.
> > >
> > > Is this a known problem?
> >
> > I can confirm this as a regression. You don't even need to mount it
> > as a root filesystem, or do this on an 68k system. On my x86 system,
> > using a kernel based off of git commit: afa26be8 (6 commits after
> > 2.6.26-rc1), mounting an ext3 filesystem, you can cause an oops by
> > taking an ext2 filesystem and forcing a mount as ext3, "mount -t ext3
> > /dev/closure/textext2fs /mnt"). (see below for my oops). This does
> > not occur with a kernel based off of 2.6.25, so it's a definite
> > regression.
>
> Hi,
>
> I posted a very similar problem a couple of days ago:
> http://www.nabble.com/BUG-in-ext3_sync_fs-td16999997.html
>
> to which I got zero replies. Can I close this in my internal bugzilla
> as dup/"not my fault"? The stacktrace looks very similar. This was
> also ext2 fs mounted (apparently) by ext3 code.
Yes, this looks like the same problem. I'll take care of that.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Problem mounting ext2 using ext3?
2008-05-06 7:26 ` Vegard Nossum
2008-05-06 9:50 ` Jan Kara
@ 2008-05-06 12:05 ` Theodore Tso
1 sibling, 0 replies; 9+ messages in thread
From: Theodore Tso @ 2008-05-06 12:05 UTC (permalink / raw)
To: Vegard Nossum
Cc: Geert Uytterhoeven, linux-ext4, Linux Kernel Development,
Linux/m68k, Jan Kara
On Tue, May 06, 2008 at 09:26:30AM +0200, Vegard Nossum wrote:
>
> I posted a very similar problem a couple of days ago:
> http://www.nabble.com/BUG-in-ext3_sync_fs-td16999997.html
>
> to which I got zero replies. Can I close this in my internal bugzilla
> as dup/"not my fault"? The stacktrace looks very similar. This was
> also ext2 fs mounted (apparently) by ext3 code.
Yeah, sorry, I didn't have network access when I looked at your
e-mail, and so I didn't see the stack trace until you pointed at the
mail message again. Because you mentioned a USB stick, I assumed it
was the problem with a USB stick getting pulled or being loose causing
an I/O error leading to an oops problem, and I missed the hint of the
problem occurring in the ext3 code when you were using an ext2
formattem. Fortunately when Geert reported the bug a second time, I
was less dense at the time, and figured it out quickly. :-)
- Ted
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Problem mounting ext2 using ext3?
2008-05-05 22:26 ` Theodore Tso
2008-05-06 7:11 ` Geert Uytterhoeven
2008-05-06 7:26 ` Vegard Nossum
@ 2008-05-06 10:02 ` Jan Kara
2008-05-06 11:20 ` Geert Uytterhoeven
2008-05-06 19:05 ` Geert Uytterhoeven
2 siblings, 2 replies; 9+ messages in thread
From: Jan Kara @ 2008-05-06 10:02 UTC (permalink / raw)
To: Theodore Tso, Geert Uytterhoeven, linux-ext4,
Linux Kernel Development, Linux/m68k
On Mon 05-05-08 18:26:23, Theodore Tso wrote:
> On Mon, May 05, 2008 at 11:11:46PM +0200, Geert Uytterhoeven wrote:
> > when mounting the root file system, which is ext2 (has_journal is not set).
> > Apparently it crashes in ext3_sync_fs because EXT3_SB(sb)->s_journal is NULL.
> >
> > At first I thought it was an issue with the byteswapped IDE bus on Atari (a
> > new and different solution to handle this just went into mainline), but if I
> > disable CONFIG_EXT3 support, it boots up fine.
> >
> > Is this a known problem?
>
> I can confirm this as a regression. You don't even need to mount it
> as a root filesystem, or do this on an 68k system. On my x86 system,
> using a kernel based off of git commit: afa26be8 (6 commits after
> 2.6.26-rc1), mounting an ext3 filesystem, you can cause an oops by
> taking an ext2 filesystem and forcing a mount as ext3, "mount -t ext3
> /dev/closure/textext2fs /mnt"). (see below for my oops). This does
> not occur with a kernel based off of 2.6.25, so it's a definite
> regression.
>
> Looks like the problem is some of the recent quota cleanups. The
> problem is that ext3_fill_super is returning an error, because the
> journal is missing. get_sb_dev() calls ext3_fill_super, and upon
> receiving an error, it is calling deactivate_super(), which calls:
>
> DQUOT_OFF(s, 0);
>
> (line 182 in fs/super.c, in deactivate_super(), recently modified just
> after 2.6.25, at comment 0ff5af8340aa6be44220d7237ef4a654314cf795,
> although I'm not sure this is actually the problem commit)).
>
> The blow up is happening because the because superblock was not fully
> set up, and the comment in the commit involved mentioned cleaning up
> what is supposed to happen when remounting a filesystem turning quota
> on or off. I'm guessing that the changes didn't take into account
> that DQUOT_OFF() can get called with a partially set-up superblock,
> which will happen when the filesystme specific get_sb() code refuses a
> mount and returns an error.
>
> Jan, can you take a look at this and confirm whether or not this is
> the root cause of the crash?
Thanks Ted for looking into this. Yes, the problem is caused by my
modifications to quota code... The patch below fixes it for me and I've
also added a comment so that someone does not remove the check again in
future ;).
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
---
>From af9d1ac1db9acea1516350d4269796061e0f2ab5 Mon Sep 17 00:00:00 2001
From: Jan Kara <jack@suse.cz>
Date: Tue, 6 May 2008 11:33:00 +0200
Subject: [PATCH] quota: Don't call sync_fs() from vfs_quota_off() when there's no quota turn off
Sometimes, vfs_quota_off() is called on a partially set up super block (for example
when fill_super() fails for some reason). In such cases we cannot call ->sync_fs()
because it can Oops because of not properly filled in super block. So in case we
find there's not quota to turn off, we just skip everything and return which fixes
the above problem.
Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/dquot.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/fs/dquot.c b/fs/dquot.c
index dfba162..bdcb15e 100644
--- a/fs/dquot.c
+++ b/fs/dquot.c
@@ -1491,6 +1491,16 @@ int vfs_quota_off(struct super_block *sb, int type, int remount)
/* We need to serialize quota_off() for device */
mutex_lock(&dqopt->dqonoff_mutex);
+
+ /*
+ * Skip everything if there's nothing to do. We have to do this becase
+ * sometimes we are called when fill_super() failed and calling
+ * sync_fs() in such cases does no good.
+ */
+ if (!sb_any_quota_enabled(sb) && !sb_any_quota_suspended(sb)) {
+ mutex_unlock(&dqopt->dqonoff_mutex);
+ return 0;
+ }
for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
toputinode[cnt] = NULL;
if (type != -1 && cnt != type)
--
1.5.2.4
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: Problem mounting ext2 using ext3?
2008-05-06 10:02 ` Jan Kara
@ 2008-05-06 11:20 ` Geert Uytterhoeven
2008-05-06 19:05 ` Geert Uytterhoeven
1 sibling, 0 replies; 9+ messages in thread
From: Geert Uytterhoeven @ 2008-05-06 11:20 UTC (permalink / raw)
To: Jan Kara; +Cc: Theodore Tso, linux-ext4, Linux Kernel Development, Linux/m68k
On Tue, 6 May 2008, Jan Kara wrote:
> Thanks Ted for looking into this. Yes, the problem is caused by my
> modifications to quota code... The patch below fixes it for me and I've
> also added a comment so that someone does not remove the check again in
> future ;).
I'll try to give it a try this evening...
> + * Skip everything if there's nothing to do. We have to do this becase
^^^^^^
because
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Problem mounting ext2 using ext3?
2008-05-06 10:02 ` Jan Kara
2008-05-06 11:20 ` Geert Uytterhoeven
@ 2008-05-06 19:05 ` Geert Uytterhoeven
1 sibling, 0 replies; 9+ messages in thread
From: Geert Uytterhoeven @ 2008-05-06 19:05 UTC (permalink / raw)
To: Jan Kara; +Cc: Theodore Tso, linux-ext4, Linux Kernel Development, Linux/m68k
On Tue, 6 May 2008, Jan Kara wrote:
> On Mon 05-05-08 18:26:23, Theodore Tso wrote:
> > On Mon, May 05, 2008 at 11:11:46PM +0200, Geert Uytterhoeven wrote:
> > > when mounting the root file system, which is ext2 (has_journal is not set).
> > > Apparently it crashes in ext3_sync_fs because EXT3_SB(sb)->s_journal is NULL.
> > >
> > > At first I thought it was an issue with the byteswapped IDE bus on Atari (a
> > > new and different solution to handle this just went into mainline), but if I
> > > disable CONFIG_EXT3 support, it boots up fine.
> > >
> > > Is this a known problem?
> >
> > I can confirm this as a regression. You don't even need to mount it
> > as a root filesystem, or do this on an 68k system. On my x86 system,
> > using a kernel based off of git commit: afa26be8 (6 commits after
> > 2.6.26-rc1), mounting an ext3 filesystem, you can cause an oops by
> > taking an ext2 filesystem and forcing a mount as ext3, "mount -t ext3
> > /dev/closure/textext2fs /mnt"). (see below for my oops). This does
> > not occur with a kernel based off of 2.6.25, so it's a definite
> > regression.
> >
> > Looks like the problem is some of the recent quota cleanups. The
> > problem is that ext3_fill_super is returning an error, because the
> > journal is missing. get_sb_dev() calls ext3_fill_super, and upon
> > receiving an error, it is calling deactivate_super(), which calls:
> >
> > DQUOT_OFF(s, 0);
> >
> > (line 182 in fs/super.c, in deactivate_super(), recently modified just
> > after 2.6.25, at comment 0ff5af8340aa6be44220d7237ef4a654314cf795,
> > although I'm not sure this is actually the problem commit)).
> >
> > The blow up is happening because the because superblock was not fully
> > set up, and the comment in the commit involved mentioned cleaning up
> > what is supposed to happen when remounting a filesystem turning quota
> > on or off. I'm guessing that the changes didn't take into account
> > that DQUOT_OFF() can get called with a partially set-up superblock,
> > which will happen when the filesystme specific get_sb() code refuses a
> > mount and returns an error.
> >
> > Jan, can you take a look at this and confirm whether or not this is
> > the root cause of the crash?
> Thanks Ted for looking into this. Yes, the problem is caused by my
> modifications to quota code... The patch below fixes it for me and I've
> also added a comment so that someone does not remove the check again in
> future ;).
Thanks Jan! Your patch fixed my problem.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 9+ messages in thread