linux/fs/ext4
Eric Sandeen 149041070d ext4: 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.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Acked-by: Andreas Dilger <adilger@clusterfs.com>
2007-10-17 18:50:04 -04:00
..
Makefile
acl.c
acl.h
balloc.c ext4: Convert bg_inode_bitmap and bg_inode_table 2007-10-17 18:50:02 -04:00
bitmap.c fs: mark nibblemap const 2007-10-17 08:42:47 -07:00
dir.c ext4: remove #ifdef CONFIG_EXT4_INDEX 2007-10-17 18:50:00 -04:00
ext4_jbd2.c
extents.c ext4: Convert ext4_extent_idx.ei_leaf to ext4_extent_idx.ei_leaf_lo 2007-10-17 18:50:03 -04:00
file.c
fsync.c ext4: sparse fixes 2007-10-17 18:50:03 -04:00
group.h Ext4: Uninitialized Block Groups 2007-10-17 18:50:00 -04:00
hash.c
ialloc.c Ext4: Uninitialized Block Groups 2007-10-17 18:50:00 -04:00
inode.c ext4: sparse fixes 2007-10-17 18:50:03 -04:00
ioctl.c
namei.c ext4: remove #ifdef CONFIG_EXT4_INDEX 2007-10-17 18:50:00 -04:00
namei.h
resize.c ext4: lighten up resize transaction requirements 2007-10-17 18:50:04 -04:00
super.c ext4: Convert s_r_blocks_count and s_free_blocks_count 2007-10-17 18:50:02 -04:00
symlink.c
xattr.c ext4: sparse fixes 2007-10-17 18:50:03 -04:00
xattr.h
xattr_security.c
xattr_trusted.c
xattr_user.c