From: Akira Fujita Date: Wed, 16 Sep 2009 18:25:39 +0000 (-0400) Subject: ext4: Fix different block exchange issue in EXT4_IOC_MOVE_EXT X-Git-Tag: v2.6.32-rc1~633^2~6 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c40ce3c9ea97425a12d7e44031a98fe50add6fc1;p=pandora-kernel.git ext4: Fix different block exchange issue in EXT4_IOC_MOVE_EXT If logical block offset of original file which is passed to EXT4_IOC_MOVE_EXT is different from donor file's, a calculation error occurs in ext4_calc_swap_extents(), therefore wrong block is exchanged between original file and donor file. As a result, we hit ext4_error() in check_block_validity(). To detect the logical offset difference in EXT4_IOC_MOVE_EXT, add checks to mext_calc_swap_extents() and handle it as error, since data exchange must be done between the same blocks in EXT4_IOC_MOVE_EXT. Reported-by: Peng Tao Signed-off-by: Akira Fujita Signed-off-by: "Theodore Ts'o" --- Reading git-diff-tree failed