ext4: calculate journal credits correctly
commitd52b8a887f6208065a8f91b1e56e3d240d69c06a
authorTheodore Ts'o <tytso@mit.edu>
Sun, 16 Nov 2008 16:05:38 +0000 (16 11:05 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 5 Dec 2008 18:55:43 +0000 (5 10:55 -0800)
tree68ffa42f76f23e1caab90dddecae30f63865007d
parent84b9421374baf41b1643bfaf16c872cf177ca9b7
ext4: calculate journal credits correctly

(cherry picked from commit ac51d83705c2a38c71f39cde99708b14e6212a60)

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ext4/inode.c