btrfs-progs: convert: Prevent accounting blocks beyond end of device
authorChandan Rajendra <chandan@linux.vnet.ibm.com>
Thu, 8 Dec 2016 13:56:19 +0000 (19:26 +0530)
committerDavid Sterba <dsterba@suse.com>
Wed, 14 Dec 2016 14:06:36 +0000 (15:06 +0100)
commit8583b613095a46b000e5ee333d6bf58cad0c2248
tree8f28f7111d93ff0f573f34a611b2a331cac21044
parent281e476b4dd89d1e1314d3123d566c83b4253a2d
btrfs-progs: convert: Prevent accounting blocks beyond end of device

When looping across data block bitmap, __ext2_add_one_block() may add
blocks which do not exist on the underlying disk. This commit prevents
this from happening by checking the block index against the maximum
block count that was present in the ext4 filesystem instance that is
being converted.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
convert/main.c