aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2008-11-06 16:49:36 -0500
committerTheodore Ts'o <tytso@mit.edu>2008-11-06 16:49:36 -0500
commitac51d83705c2a38c71f39cde99708b14e6212a60 (patch)
treee540265888154d1f1b4613a118252b19a31db5db
parent14ce0cb411c88681ab8f3a4c9caa7f42e97a3184 (diff)
ext4: calculate journal credits correctly
This fixes a 2.6.27 regression which was introduced in commit a02908f1. We weren't passing the chunk parameter down to the two subections, ext4_indirect_trans_blocks() and ext4_ext_index_trans_blocks(), with the result that massively overestimate the amount of credits needed by ext4_da_writepages, especially in the non-extents case. This causes failures especially on /boot partitions, which tend to be small and non-extent using since GRUB doesn't handle extents. This patch fixes the bug reported by Joseph Fannin at: http://bugzilla.kernel.org/show_bug.cgi?id=11964 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r--fs/ext4/inode.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 8dbf6953845b..5a130b56f1cf 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -4580,9 +4580,10 @@ static int ext4_indirect_trans_blocks(struct inode *inode, int nrblocks,
4580static int ext4_index_trans_blocks(struct inode *inode, int nrblocks, int chunk) 4580static int ext4_index_trans_blocks(struct inode *inode, int nrblocks, int chunk)
4581{ 4581{
4582 if (!(EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL)) 4582 if (!(EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL))
4583 return ext4_indirect_trans_blocks(inode, nrblocks, 0); 4583 return ext4_indirect_trans_blocks(inode, nrblocks, chunk);
4584 return ext4_ext_index_trans_blocks(inode, nrblocks, 0); 4584 return ext4_ext_index_trans_blocks(inode, nrblocks, chunk);
4585} 4585}
4586
4586/* 4587/*
4587 * Account for index blocks, block groups bitmaps and block group 4588 * Account for index blocks, block groups bitmaps and block group
4588 * descriptor blocks if modify datablocks and index blocks 4589 * descriptor blocks if modify datablocks and index blocks