ext4: fix the returned block count if EXT4_IOC_MOVE_EXT fails
commita4a87a7f39020ea18f220c9e9c8ab112ebd6764a
authorAkira Fujita <a-fujita@rs.jp.nec.com>
Mon, 23 Nov 2009 12:25:48 +0000 (23 07:25 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 14 Dec 2009 17:44:49 +0000 (14 09:44 -0800)
treef2ddfde2c78f760c1f9839066b4baec3c2a29918
parent8ed33ff5203300ac8878042bc4d4954e2f40c488
ext4: fix the returned block count if EXT4_IOC_MOVE_EXT fails

(cherry picked from commit f868a48d06f8886cb0367568a12367fa4f21ea0d)

If the EXT4_IOC_MOVE_EXT ioctl fails, the number of blocks that were
exchanged before the failure should be returned to the userspace
caller.  Unfortunately, currently if the block size is not the same as
the page size, the returned block count that is returned is the
page-aligned block count instead of the actual block count.  This
commit addresses this bug.

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