2007-05-07 14:27:42

by Theodore Ts'o

[permalink] [raw]
Subject: Re: JBD: ext2online wants too many credits (744 > 256)

On Mon, May 07, 2007 at 12:26:26AM +0200, Frank van Maarseveen wrote:
> 2.6.20.6, FC4:
>
> |JBD: ext2online wants too many credits (744 > 256)

You would be better off using resize2fs from e2fsprogs 1.39, BTW....

About the only reason to keep using the ext2resize packages is
ext2prepare, which is the off-line tool to add a resizing inode after
the fact, and the main reason that functionality hasn't been absorbed
into e2fsprogs is that it needs to be completely rewritten before I'm
willing to trust and maintain it...

> What is the limitation I should be aware of? Has it something to do with
> the journal log size?

Yes, the problem is the journal log size. Since the original
filesystem was so small, the journal was kept small so as not to use a
huge percentage of the filesystem size. Of course, with a larger
filesystem you probably want a larger journal anyway to get better
performance. So that brings up a related problem, which is we don't
have a way of dynamically increasing the size of the journal, which we
probably would want to do as part of resizing the filesystem size.

So the short-term workaround for now, if you know that you're going to
take a filesystem which is 22M and increase it to 3G, is to create it
with largish journal in the first place:

mke2fs -j -b 4096 -J size=16M /dev/vol1/project 22812

Note that if you were creating a 3G filesystem from scratch, by
default it would be using a 128M journal --- but it's a little hard to
fit a 128M journal in a 22M filesystem. :-/

We're going to have to rethink the defaults of the journal size as it
relates to on-line resizing, but there might not be a lot of great
answers here. We'll also have to look at the on-line resizing code
and see if there's a way to break up the resize operation into smaller
transactions as a way of avoiding this problem --- but that would
still leave the user stuck with a pathetically small 4M journal on a
3G filesystem.

- Ted


2007-05-07 14:46:38

by David Lang

[permalink] [raw]
Subject: Re: JBD: ext2online wants too many credits (744 > 256)

On Mon, 7 May 2007, Theodore Tso wrote:

> We're going to have to rethink the defaults of the journal size as it
> relates to on-line resizing, but there might not be a lot of great
> answers here. We'll also have to look at the on-line resizing code
> and see if there's a way to break up the resize operation into smaller
> transactions as a way of avoiding this problem --- but that would
> still leave the user stuck with a pathetically small 4M journal on a
> 3G filesystem.

why not just allocate a new journal (something along the lines of convert
the ext3 to ext2 then back to ext3 would be the ugly, scripted way of
doing it)

or is the problem that you are trying to resize things without remounting
them (and therefor without flushing the journal)

David Lang

2007-05-07 15:50:28

by Theodore Ts'o

[permalink] [raw]
Subject: Re: JBD: ext2online wants too many credits (744 > 256)

On Mon, May 07, 2007 at 07:46:38AM -0700, [email protected] wrote:
> On Mon, 7 May 2007, Theodore Tso wrote:
>
> >We're going to have to rethink the defaults of the journal size as it
> >relates to on-line resizing, but there might not be a lot of great
> >answers here. We'll also have to look at the on-line resizing code
> >and see if there's a way to break up the resize operation into smaller
> >transactions as a way of avoiding this problem --- but that would
> >still leave the user stuck with a pathetically small 4M journal on a
> >3G filesystem.
>
> why not just allocate a new journal (something along the lines of convert
> the ext3 to ext2 then back to ext3 would be the ugly, scripted way of
> doing it)
>
> or is the problem that you are trying to resize things without remounting
> them (and therefor without flushing the journal)

Yes, I'm referring to the difficulties of getting this right when
doing online (mounted) resizing, as that was the context of the
original bug report.

Clearly the right thing for resize2fs to do when it's doing an
off-line resize is to just adjust the journal inode and make it
bigger. I'll add that to my todo list, but of course, patches to do
that would be gratefully accepted...

- Ted

2007-05-07 21:06:07

by Andreas Dilger

[permalink] [raw]
Subject: Re: JBD: ext2online wants too many credits (744 > 256)

On May 07, 2007 11:50 -0400, Theodore Tso wrote:
> On Mon, May 07, 2007 at 07:46:38AM -0700, [email protected] wrote:
> > On Mon, 7 May 2007, Theodore Tso wrote:
> > >We're going to have to rethink the defaults of the journal size as it
> > >relates to on-line resizing, but there might not be a lot of great
> > >answers here. We'll also have to look at the on-line resizing code
> > >and see if there's a way to break up the resize operation into smaller
> > >transactions as a way of avoiding this problem --- but that would
> > >still leave the user stuck with a pathetically small 4M journal on a
> > >3G filesystem.
>
> Clearly the right thing for resize2fs to do when it's doing an
> off-line resize is to just adjust the journal inode and make it
> bigger. I'll add that to my todo list, but of course, patches to do
> that would be gratefully accepted...

For that matter, there was a paper from U. Wisconsin showing that
having the journal in the middle of the filesystem gave noticably
better performance due to lower average seek times. If anyone is
looking at messing with the journal that is probably also a good
and easy place to start (e.g. may be as easy as just giving a goal
block of s_blocks_count / 2 to the journal create code).

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.