Don't actually panic if a journal checksum failure is detected on
[ext4-patch-queue.git] / jbd2-blocks-reservation-fix-for-large-blk.patch
blobd41da13199c0a099948dc84bbf8ba2d28a191f55
1 jbd2: blocks reservation fix for large block support
3 From: Mingming Cao <cmm@us.ibm.com>
5 The blocks per page could be less or quals to 1 with the large
6 block support in VM. The patch fixed the way to calculate the
7 number of blocks to reserve in journal in the case blocksize > pagesize.
9 Signed-off-by: Mingming Cao <cmm@us.ibm.com>
10 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 ---
14 fs/jbd2/journal.c | 7 ++++++-
15 1 file changed, 6 insertions(+), 1 deletion(-)
18 Index: linux-2.6.26-rc4/fs/jbd2/journal.c
19 ===================================================================
20 --- linux-2.6.26-rc4.orig/fs/jbd2/journal.c 2008-05-29 10:52:27.000000000 -0700
21 +++ linux-2.6.26-rc4/fs/jbd2/journal.c 2008-05-29 10:52:41.000000000 -0700
22 @@ -1935,7 +1935,12 @@ void jbd2_journal_ack_err(journal_t *jou
24 int jbd2_journal_blocks_per_page(struct inode *inode)
26 - return 1 << (PAGE_CACHE_SHIFT - inode->i_sb->s_blocksize_bits);
27 + int bits = PAGE_CACHE_SHIFT - inode->i_sb->s_blocksize_bits;
29 + if (bits > 0)
30 + return 1 << bits;
31 + else
32 + return 1;