jbd: blocks reservation fix for large block support From: Mingming Cao The blocks per page could be less or quals to 1 with the large block support in VM. The patch fixed the way to calculate the number of blocks to reserve in journal in the case blocksize > pagesize. Signed-off-by: Mingming Cao Signed-off-by: "Theodore Ts'o" --- fs/jbd/journal.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) Index: linux-2.6.25-rc3/fs/jbd/journal.c =================================================================== --- linux-2.6.25-rc3.orig/fs/jbd/journal.c 2008-03-03 11:45:58.000000000 -0800 +++ linux-2.6.25-rc3/fs/jbd/journal.c 2008-03-03 15:53:02.000000000 -0800 @@ -1604,7 +1604,12 @@ void journal_ack_err(journal_t *journal) int journal_blocks_per_page(struct inode *inode) { - return 1 << (PAGE_CACHE_SHIFT - inode->i_sb->s_blocksize_bits); + int bits = PAGE_CACHE_SHIFT - inode->i_sb->s_blocksize_bits; + + if (bits > 0) + return 1 << bits; + else + return 1; } /*