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 --- fs/jbd/journal.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) Index: linux-2.6.23-rc8/fs/jbd/journal.c =================================================================== --- linux-2.6.23-rc8.orig/fs/jbd/journal.c 2007-10-01 20:36:12.000000000 -0700 +++ linux-2.6.23-rc8/fs/jbd/journal.c 2007-10-01 21:11:43.000000000 -0700 @@ -1603,7 +1603,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; } /*