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 files changed, 6 insertions(+), 1 deletions(-) diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c index 5d14243..7b32029 100644 --- a/fs/jbd/journal.c +++ b/fs/jbd/journal.c @@ -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; } /*