Whamcloud - gitweb
libext2fs: fix i_blocks for extent leaf create/delete with bigalloc
authorAditya Kali <adityakali@google.com>
Mon, 11 Jun 2012 03:52:11 +0000 (23:52 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 11 Jun 2012 03:52:11 +0000 (23:52 -0400)
commite0e2c7db4d753aa0192a4a78974fb01bee8a2fb4
treefaccc9c264efe5b71d5a21bb08a0acceb848cea0
parent63b3913dbc0bc7cdf8a63f3bdb0c8d7d605e9a40
libext2fs: fix i_blocks for extent leaf create/delete with bigalloc

When libext2fs allocates/deletes an extent leaf, the i_blocks
value is incremented/decremented by fs->blocksize / 512. This
is incorrect in case of bigalloc. The correct way here is to
use cluster_size / 512.

The problem is seen if we try to create a large inode using
libext2fs (say using ext2fs_block_iterate3()) on a bigalloc
filesystem. fsck catches this and complains.

Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/extent.c