Whamcloud - gitweb
e2fsck: make block counting variable in pass1 64 bits
authorEric Sandeen <sandeen@redhat.com>
Tue, 30 Mar 2010 16:42:51 +0000 (11:42 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 13 May 2010 17:33:53 +0000 (13:33 -0400)
commit65d71894c9f254ea1a5eb836e454dd263b13a867
treeb579c66fe726c8202f42e55c9e917c7ee729a395
parent5750e5f9246ead0bc2af7da0cb5bcdfc916cace6
e2fsck: make block counting variable in pass1 64 bits

Justin reported that creating a 4T file with posix_fallocate led
to fsck errors:

e2fsck 1.41.10 (10-Feb-2009)
Pass 1: Checking inodes, blocks, and sizes
Inode 12, i_blocks is 8589935432, should be 840.  Fix? yes

This looks like a 32-bit overflow.

commmit 8a8f36540bbf5d4397cf476e216e9a720b5c1d8e added handling of
the high i_blocks number, but we accumulate blocks in the num_blocks
field, and that's still just 32 bits.

Note: we don't need to expand max_blocks for now, that's only used
in the non-extents case, and those files have smaller max sizes.

I haven't been able to replicate the problem, oddly, but Justin
reports that this patch fixed his situation.

Reported-by: Justin Maggard <jmaggard10@gmail.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/pass1.c