ext4: Fix wrong comparisons in mext_check_arguments()
authorAkira Fujita <a-fujita@rs.jp.nec.com>
Wed, 16 Sep 2009 18:28:22 +0000 (14:28 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 14 Dec 2009 16:06:22 +0000 (08:06 -0800)
commitad6030eecf171af161ad4c215c8d3f967b5ddfc5
treea3fef9c099283f176bfe4c35032920d0f57fdc0a
parent2a8af5d4d0f69036fc02e91642f862e473350143
ext4: Fix wrong comparisons in mext_check_arguments()

(cherry picked from commit 70d5d3dcea47c16058d2b093c29e07fdf61b56ad)

The mext_check_arguments() function in move_extents.c has wrong
comparisons.  orig_start which is passed from user-space is block
unit, but i_size of inode is byte unit, therefore the checks do not
work fine.  This mis-check leads to the overflow of 'len' and then
hits BUG_ON() in ext4_move_extents().  The patch fixes this issue.

Signed-off-by: Akira Fujita <a-fujita@rs.jp.nec.com>
Reviewed-by: Greg Freemyer <greg.freemyer@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ext4/move_extent.c