2010-08-05 19:26:54

by Andreas Dilger

[permalink] [raw]
Subject: [PATCH] allow internal journal size 2GB or larger

The current libext2fs and e2fsck code does not handle an internal journal inode size larger than 2GB because of 32-bit overflow. The high bits of the journal are not stored on disk correctly, nor are they backed up into the superblock. This is not a problem with a large external journal device.

Fix the code to correctly process the high bits of the journal size. It turns out there is also space in the superblock journal backup to hold the high bits of the journal size (in s_jnl_blocks[15]), because there are 17 words reserved for this field, but the i_blocks field only uses EXT2_N_BLOCKS = 15 blocks [0-14], and the journal size is stored in [16], so no change to the on-disk format is needed.

Signed-off-by: Andreas Dilger <[email protected]>

Cheers, Andreas
--
Andreas Dilger
Lustre Technical Lead
Oracle Corporation Canada Inc.


Attachments:
e2fsprogs-bigjournal.diff (9.19 kB)

2010-09-07 13:07:56

by Amir G.

[permalink] [raw]
Subject: Re: [PATCH] allow internal journal size 2GB or larger

On Thu, Aug 5, 2010 at 10:26 PM, Andreas Dilger
<[email protected]> wrote:
>
> The current libext2fs and e2fsck code does not handle an internal journal inode size larger than 2GB because of 32-bit overflow.
>

I was surprised to see this problem description, since I have been
using a 3GB journal with Next3 for a while and never observed this
problem reported by fsck.
Finally, I realized that the problem only happens when the journal
inode size is larger than 4GB.

Other than that, patch looks fine to me :-)

Amir.