]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ext4: Return exchanged blocks count to user space in failure
authorAkira Fujita <a-fujita@rs.jp.nec.com>
Sun, 6 Sep 2009 02:46:29 +0000 (22:46 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 14 Dec 2009 16:06:24 +0000 (08:06 -0800)
(cherry picked from commit 8d6669133d8cdbb7cbe0e1f0f3744e7802a84afe)

Return exchanged blocks count (moved_len) to user space,
if ext4_move_extents() failed on the way.

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/ioctl.c

index 7050a9cd04a4361bb66851781b9e494893f257ee..c1cdf613e7258e39f2964768c2d65b6422ce8c96 100644 (file)
@@ -243,10 +243,9 @@ setversion_out:
                                        me.donor_start, me.len, &me.moved_len);
                fput(donor_filp);
 
-               if (!err)
-                       if (copy_to_user((struct move_extent *)arg,
-                               &me, sizeof(me)))
-                               return -EFAULT;
+               if (copy_to_user((struct move_extent *)arg, &me, sizeof(me)))
+                       return -EFAULT;
+
                return err;
        }