2007-05-07 04:40:21

by Andrew Morton

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

On Mon, 7 May 2007 00:26:26 +0200 Frank van Maarseveen <[email protected]> wrote:

> 2.6.20.6, FC4:
>
> I created a 91248k ext3 fs with 4k blocksize:
>
> | mke2fs -j -b 4096 /dev/vol1/project
> | mke2fs 1.38 (30-Jun-2005)
> | Filesystem label=
> | OS type: Linux
> | Block size=4096 (log=2)
> | Fragment size=4096 (log=2)
> | 23552 inodes, 23552 blocks
> | 1177 blocks (5.00%) reserved for the super user
> | First data block=0
> | Maximum filesystem blocks=25165824
> | 1 block group
> | 32768 blocks per group, 32768 fragments per group
> | 23552 inodes per group
>
> Writing inode tables: done
> Creating journal (1024 blocks): done
> Writing superblocks and filesystem accounting information: done
>
> Next, I tried to resize it to about 3G using ext2online while mounted:
>
> | # ext2online /dev/vol1/project
> | ext2online v1.1.18 - 2001/03/18 for EXT2FS 0.5b
> | ext2online: ext2_ioctl: No space left on device
> |
> | ext2online: unable to resize /dev/mapper/vol1-project
>
> At that time the kernel said:
>
> |JBD: ext2online wants too many credits (744 > 256)
>
> What is the limitation I should be aware of? Has it something to do with
> the journal log size?
>
> The size actually did increase a bit, to 128112k.
>
>
> Steps to reproduce:
> Create a 3G partition, say /dev/vol1/project
> mke2fs -j -b 4096 /dev/vol1/project 22812
> mount it
> ext2online /dev/vol1/project said:
>
> | ext2online v1.1.18 - 2001/03/18 for EXT2FS 0.5b
> | ext2online: ext2_ioctl: No space left on device
> |
> | ext2online: unable to resize /dev/mapper/vol1-project
>
> kernel said:
>
> | JBD: ext2online wants too many credits (721 > 256)
>

(added linux-ext4 to cc)


2007-05-07 13:53:10

by Frank van Maarseveen

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

On Sun, May 06, 2007 at 09:40:14PM -0700, Andrew Morton wrote:
> On Mon, 7 May 2007 00:26:26 +0200 Frank van Maarseveen <[email protected]> wrote:
>
> > Steps to reproduce:
> > Create a 3G partition, say /dev/vol1/project
> > mke2fs -j -b 4096 /dev/vol1/project 22812
> > mount it
> > ext2online /dev/vol1/project said:
> >
> > | ext2online v1.1.18 - 2001/03/18 for EXT2FS 0.5b
> > | ext2online: ext2_ioctl: No space left on device
> > |
> > | ext2online: unable to resize /dev/mapper/vol1-project
> >
> > kernel said:
> >
> > | JBD: ext2online wants too many credits (721 > 256)

There's a threshold for the problem depending on the initial
size. This one fails:

mke2fs -j -b 4096 /dev/<3GB-blockdev> 32768
(mount + ext2online or resize2fs)
kernel: JBD: resize2fs wants too many credits (1034 > 1024)

Add one block to the initial mke2fs (32768+1 == 32769) and the
problem is gone.

Without the -b 4096 there's another resize problem

mke2fs -j /dev/loop1 2048
mount /dev/loop1 /1
resize2fs /dev/loop1

says:
resize2fs 1.40-WIP (14-Nov-2006)
Filesystem at /dev/loop1 is mounted on /1; on-line resizing required
old desc_blocks = 1, new_desc_blocks = 12
Performing an on-line resize of /dev/loop1 to 3072000 (1k) blocks.
resize2fs: Invalid argument While trying to add group #256

and the kernel says:

May 7 15:36:08 lokka EXT3-fs warning (device loop1): verify_reserved_gdb:
May 7 15:36:08 lokka reserved GDT 10 missing grp 1 (8202)
May 7 15:36:08 lokka

After that, the filesystem has been resized to 2GB. I recall a 2G
(?) limit for ext3 resizing with 1k blocksize but trying the above with
4096 1k blocks seems to work. fsck says it's ok all the time.

--
Frank

2007-05-07 18:51:44

by Andreas Dilger

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

On May 06, 2007 21:40 -0700, Andrew Morton wrote:
> On Mon, 7 May 2007 00:26:26 +0200 Frank van Maarseveen <[email protected]> wrote:
>
> > 2.6.20.6, FC4:
> >
> > I created a 91248k ext3 fs with 4k blocksize:
> >
> > Next, I tried to resize it to about 3G using ext2online while mounted:
> >
> > At that time the kernel said:
> >
> > |JBD: ext2online wants too many credits (744 > 256)
> >
> > What is the limitation I should be aware of? Has it something to do with
> > the journal log size?

Yes, for very small filesystems the default journal size is only 4MB, and
the maximum transaction size is 1MB (256 blocks).

If the filesystem was 128MB or larger in the initial mke2fs then the
journal would be 16MB and the resize would get up to 1024 blocks for
the transaction.

I'm not sure what the right solution is for this. If you know you will
be resizing the fs you could increase the initial journal size at mke2fs
time (-J size=16). Alternately, it is possible resize to an intermediate
size and then delete and recreate the journal via tune2fs (which would
be the larger size by default) but that can only be done offline.

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