linux/fs/ext3
Eric Sandeen 1ad6ecf914 ext3: lighten up resize transaction requirements
When resizing online, setup_new_group_blocks attempts to reserve a
potentially very large transaction, depending on the current filesystem
geometry.  For some journal sizes, there may not be enough room for this
transaction, and the online resize will fail.

The patch below resizes & restarts the transaction as necessary while
setting up the new group, and should work with even the smallest journal.

Tested with something like:

[root@newbox ~]# dd if=/dev/zero of=fsfile bs=1024 count=32768
[root@newbox ~]# mkfs.ext3 -b 1024 fsfile 16384
[root@newbox ~]# mount -o loop fsfile mnt/
[root@newbox ~]# resize2fs /dev/loop0
resize2fs 1.40.2 (12-Jul-2007)
Filesystem at /dev/loop0 is mounted on /root/mnt; on-line resizing required
old desc_blocks = 1, new_desc_blocks = 1
Performing an on-line resize of /dev/loop0 to 32768 (1k) blocks.
resize2fs: No space left on device While trying to add group #2
[root@newbox ~]# dmesg | tail -n 1
JBD: resize2fs wants too many credits (258 > 256)
[root@newbox ~]#

With the below change, it works.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Acked-by: Andreas Dilger <adilger@clusterfs.com>
Cc: <linux-ext4@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-17 08:43:01 -07:00
..
Makefile [PATCH] ext3: uninline large functions 2006-12-07 08:39:35 -08:00
acl.c Introduce is_owner_or_cap() to wrap CAP_FOWNER use with fsuid check 2007-07-17 12:00:03 -07:00
acl.h [PATCH] Remove leftover ext3 acl declarations 2006-07-10 13:24:26 -07:00
balloc.c ext2/ext3/ext4: add block bitmap validation 2007-10-17 08:42:52 -07:00
bitmap.c fs: mark nibblemap const 2007-10-17 08:42:47 -07:00
dir.c ext3: remove #ifdef CONFIG_EXT3_INDEX 2007-10-17 08:43:01 -07:00
ext3_jbd.c [PATCH] ext3: uninline large functions 2006-12-07 08:39:35 -08:00
file.c sendfile: remove .sendfile from filesystems that use generic_file_sendfile() 2007-07-10 08:04:13 +02:00
fsync.c [PATCH] ext3 and jbd cleanup: remove whitespace 2006-09-27 08:26:09 -07:00
hash.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
ialloc.c remove unused bh in calls to ext234_get_group_desc 2007-10-17 08:42:49 -07:00
inode.c ext3: convert to new aops 2007-10-16 09:42:55 -07:00
ioctl.c Introduce is_owner_or_cap() to wrap CAP_FOWNER use with fsuid check 2007-07-17 12:00:03 -07:00
namei.c ext3: remove #ifdef CONFIG_EXT3_INDEX 2007-10-17 08:43:01 -07:00
namei.h [PATCH] ext3: sparse fixes 2005-10-30 17:37:25 -08:00
resize.c ext3: lighten up resize transaction requirements 2007-10-17 08:43:01 -07:00
super.c ext3: show all mount options 2007-10-17 08:42:48 -07:00
symlink.c [PATCH] mark struct inode_operations const 1 2007-02-12 09:48:46 -08:00
xattr.c [PATCH] "ext[34]: EA block reference count racing fix" performance fix 2007-03-23 11:01:22 -07:00
xattr.h Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
xattr_security.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
xattr_trusted.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
xattr_user.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00