jbd2: 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/jbd2/journal.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) Index: linux-2.6.26-rc1/fs/jbd2/journal.c =================================================================== --- linux-2.6.26-rc1.orig/fs/jbd2/journal.c 2008-05-05 17:10:09.000000000 -0700 +++ linux-2.6.26-rc1/fs/jbd2/journal.c 2008-05-05 17:10:17.000000000 -0700 @@ -1935,7 +1935,12 @@ void jbd2_journal_ack_err(journal_t *jou int jbd2_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; } /*